Question: 4 (50p) Let us return to our array A = [5, 6, 4, 7, 3, 8, 2,9,1, 10) from problem set 2, which we still

 4 (50p) Let us return to our array A = [5,

4 (50p) Let us return to our array A = [5, 6, 4, 7, 3, 8, 2,9,1, 10) from problem set 2, which we still want to sort in increasing order. 4a (40p) Run he ap sort by hand on this array, and show in detail in every step of the algorithm what calls to the heap are made and how the array and the heap change. 4b (10 p) Suppose that we build a max-heap from any given array A. Is it true that once the array A has been converted to a correct max-heap, then considering the elements in reverse order (i.e., A[n], A[n 1),..., A[2], A[1]) yields a correct min-heap? Prove this or give a simple counter-example

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!