Question: please answer in C + + Consider a ternary heap structure. Given the BuildHeap ( ) procedure below to build a heap from an array

please answer in C++ Consider a ternary heap structure.
Given the BuildHeap () procedure below to build a heap from an array H:
BuildHeap(H) :
for \(\mathrm{k}=\) floor(H.size()-2)/3) downto 0:
H.heapify(k)
Applying the BuildHeap() procedure to the tree above,
a. Redraw the tree after each time the heapify() method is called. every step
b. Write out the final array.
c. Now the array H becomes a heap. What would H become if the delete_min() method is called?
d. Write the code for the heapify() method. please answer in C++
please answer in C + + Consider a ternary heap

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 Programming Questions!