Question: Given an array A = 7 , 6 , 5 , 4 , 3 , 2 , 1 > , apply the bottom - up
Given an array apply the bottomup heap construction
algorithm buildMinHeap to transform it into a minheap. Please show the
updated array after each swap made during the downHeap procedure.
Follow the pseudocode provided from M slides:
buildMinHeap
for down to
downHeap
downHeap A i
smallest index of the smallest element among
and its two children
if smallest
swap with smallest
downHeapA smallest
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
