Question: Show the steps of building a heap from the array A- [1 4 123 8 16 4 20] with n-8 elements. Draw the array and

Show the steps of building a heap from the array A- [1 4 123 8 16 4 20] with n-8 elements. Draw the array and the tree after each iteration in the for loop. BuildMaxHeap (A, n) 1 for (i-floor (n/2) ;i>-1;i--) 2 MaxHeapify (A,n, i) Then, draw how the tree and the array A will look like after each of the following operations. a. After ExtractMax() b. After Insert(10) this is called after calling ExtractMax) above
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
