Docsity

Heap Exercise-Complexity of Algorithms-Assignment, Exercises of Advanced Algorithms

Toggle sidebar
bg1
A Heap(ing) Portion
1. Insert the items into a heap (that is initially empty) in the order given
below:
12,6,20,11,7,9,15,10,3
Draw the heap after each insertion. Give a vector representation of the
heap after the last item has been inserted.
2. Consider the heap given below.
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.
1
docsity.com

Partial preview of the text

Download Heap Exercise-Complexity of Algorithms-Assignment and more Exercises Advanced Algorithms in PDF only on Docsity!

A Heap(ing) Portion

  1. Insert the items into a heap (that is initially empty) in the order given below: 12 , 6 , 20 , 11 , 7 , 9 , 15 , 10 , 3 Draw the heap after each insertion. Give a vector representation of the heap after the last item has been inserted.
  2. Consider the heap given below.

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.

docsity.com