Question: Consider the following array. A = [ 7 , 8 , 2 , 1 , 4 , 6 , 3 , 5 ] 1 .
Consider the following array.
A
Show the array as a heap.
Preform the BuildMaxHeap algorithm on A Show the heap after each swap you make.
hint: you should draw the heap times not counting the initial heap you made in question
Preform the HeapSort algorithm on A Show the heap after each iteration of the for loop.
hint: you should draw the heap times not including the empty heap when the array is fully sorted
or the initial max heap you created in question
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
