100% Guaranteed Results


Exercises – Programming assignment 3 Solved
$ 20.99
Category:

Description

5/5 – (1 vote)

Heap sort

Input (Standard input)
The number of input keys N (1 ≤ N ≤ 100,000), and an integer k are given (1 ≤ k ≤ 30) in the first line
In the next N lines, a key is given in each line.

Output (Standard output)
In the first line, print k biggest elements in decreasing order.
In the second line, print the heap after extracting k biggest elements.

[Example]
Input Output
10 4
16
14
10
8
7
9
3
2
4
1 16 14 10 9
8 7 3 4 2 1

Description
1. File name must be Heapsort.cpp
2. Make a comment of your student ID, name and class in the first line of the source code. ex) 2008601028_Honggildong_A or 2008601028_홍길동_A
3. Please keep the source code that you have submitted for some unexpected accident.

Reviews

There are no reviews yet.

Be the first to review “Exercises – Programming assignment 3 Solved”

Your email address will not be published. Required fields are marked *

Related products