Question: dont use tabs In a max heap (largest value at the root), when we call deleteMax, the root is replaced by the last item in

dont use tabs In a max heap (largest value at the root), when we call deleteMax, the root is replaced by the last item in the heap and "trickles down" to the correct position. In the binary heap below, the last item happens to be 1. Replace the X's with actual positive values (no duplicates), so you have a legal max heap and after each of the 4 calls to deleteMax, the number 1 trickles down to the last position again. "Draw" the resulting heap after each deleteMax. (You might want to copy over your original heap four times instead of entering the numbers again.) Original Heap:   

dont use tabs In a max heap (largest value at the root),

 After first deleteMax: when we call deleteMax, the root is replaced by the last item After second deleteMax: in the heap and "trickles down" to the correct position. In the After third deleteMax: binary heap below, the last item happens to be 1. Replace the After fourth deleteMax: X's with actual positive values (no duplicates), so you have a legal 

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!