Question: a. Construct a heap for the list W, E, L, C, O, M, E by either the top-down or the bottom-up algorithm b. Apply heapsort
b. Apply heapsort to sort the above list. Show the intermediate heap of each step.
c. Discuss the best case, worst case, and average case of heapsort
d. Is heapsort stable? Why? If not, give a counterexample.
e. Is heapsort in-place? Why? If not, give a counterexample.
Step by Step Solution
3.29 Rating (146 Votes )
There are 3 Steps involved in it
a Construct a Heap To construct a max heap for the list W E L C O M E we can use the bottomup also known as heapify algorithm The key idea is to start ... View full answer
Get step-by-step solutions from verified subject matter experts
