Question: 3. Part A: Assume that a priority queue is implemented using a max heap. Show the contents of the max heap array that results from

3. Part A: Assume that a priority queue is implemented using a max heap. Show the contents of the max heap array that results from enqueuing (inserting) the following sequence of integer priorities into a heap that is initially empty:

6 44 20 27 73 34 10 22 89

Assume the array begins with 10 elements. Show your final answer in the form of an array, not as a binary tree, leaving any unused array slots blank.

Part B: Assume that a priority queue is implemented using a min heap and the following shows the contents of the array, with slot 0 going unused:

3 20 7 24 41 15 32 56 72

Show the contents of the min heap array after three dequeue (removeMin) operations are done. Show your final answer in the form of an array, not as a binary tree, leaving any unused array slots blank.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!