To see the answer to the questions in this section, click the All button at the top of the window.

Question

The array A below represents a binary heap implementation of a priority queue of items. Only the integer key values of the items are shown. The priority queue is arranged with the lowest-value key first.

Draw the binary heap structure (tree) represented by A.

Answer

Question

Below is the binary heap structure from Question 1:

Draw the heap structure after the lowest-key item has been removed.

Answer

Question

Below is the binary heap structure from Question 1:

Draw the heap structure after a new item with key 1 has been added.

Answer