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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started