CMPS 144L: Lab Activity on Heaps

                2
               / \
              /   \
             /     \
            /       \
           /         \
          /           \
         /             \
        5               7
       / \             / \
      /   \           /   \
     /     \         /     \
    /       \       /       \
   6        15     12        9
  / \      /  \
 /   \    /    \
8    14  23    18
Consider the min-heap shown nearby, assumed to represent a priority queue in which priorities increase as keys decrease. (Only the keys are shown and not any associated data.)

1. Show the contents of an array that represents the heap.

2. Carry out the following operations in succession, showing what the heap looks like after each operation has been completed.

(a) insert(16)
(b) insert(-1)
(c) deleteMin()
(d) deleteMin()