Heaps and Heaps Sort

October 6th, 2015

Heaps and Heap Sort

Screen Shot 2015-10-08 at 1.14.31 PM

Homework:
1. Draw the max-heap that results from adding the following integers (34 45 3 87 65 32 1 12 17).
2. Starting with the resulting tree from Exercise 11.1, draw the tree that results from performing a removeMin operation.
3. Starting with an empty minheap, draw the heap after each of the following operations:
addElement(40);
addElement(25):
removeMin();
addElement(10);
removeMin();
addElement(5);
addElement(1);
removeMin();
addElement(45);
addElement(50);