(Solved):Construct a heap first by using the bottom-up algorithm and then by using the top-down (successive key insertions) algorithm for the list 1, 8, 6, 5, 3, 7, 4. Is it always true that the bottom-up a… View Answer…

 

Question

Construct a heap first by using the bottom-up algorithm and then by using the top-down (successive key insertions) algorithm for the list 1, 8, 6, 5, 3, 7, 4. Is it always true that the bottom-up and top-down algorithms yield the same heap for the same input?

 

EXPERT ANSWER

Bottom-up algorithm:

In the bottom-up algorithm the array, values are making the heap directly like 1st value is becoming root and then 2nd value

Scroll to top