Question: Construct a heap for a list 2, 9, 7, 6, 5, 8, 4, 3, 10, 1. Please output the process of heap construction properly. 2.
Construct a heap for a list 2, 9, 7, 6, 5, 8, 4, 3, 10, 1. Please output the process of heap construction properly.
2. Output a sorted list (in decreasing order) based on the heap, using heapsort algorithm
? Reference HeapBottomUp pseudo code for a heap construction from Textbook pp. 229
? Heapsort can be done by applying the root-deletion operation n-1 times to the remained heap. (pp. 231 232)
? Your code should have no compile error.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
