Question: a ) Starting with the procedure MAX - HEAPIFY, write pseudocode for the procedure MIN - HEAPIFY ( A , i , n ) ,

a) Starting with the procedure MAX-HEAPIFY, write pseudocode for the procedure MIN-
HEAPIFY (A, i,n), which performs the corresponding manipulation on a min-heap. How does the
running time of MIN-HEAPIFY compare with that of MAX-HEAPIFY?
b) Considering the function of Build-Max-Heap, write pseudocode for the procedure BUILD-
MIN-HEAP.
c) Comment on whether or not will there be any change in the procedure HEAP-SORT keeping in
mind the modifications done in parts (a) and (b). Give valid arguments.
d) Illustrate the operation of BUILD-MAX-HEAP and then HEAP-SORT on the array A=,
19,20,15,13,10,2,17,16,12; with root at index 1. Show all steps with elements of array after
each operation.
 a) Starting with the procedure MAX-HEAPIFY, write pseudocode for the procedure

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!