

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


A Heap(ing) Portion
First perform two DeleteMin operations on this heap. Then insert the element 14 into the heap. Finally perform one more DeleteMin opera- tion. As above, draw the heap after each step and give the final vector representation after all the operations have been performed.
Solution:
Remember that to insert an element, you put it in the right-most empty child on the bottom level, then it “bubbles up” to its proper level by swapping with its parent (if necessary, i.e. if it’s less than its parent). The final vector representation of this heap is the vector (3, 6 , 9 , 7 , 11 , 20 , 15 , 12 , 10),