Question: A priority queue containing characters is implemented as a heap stored in an array. The precondition states that this priority queue cannot contain duplicate elements.
A priority queue containing characters is implemented as a heap stored in an array. The precondition states that this priority queue cannot contain duplicate elements. Currently, the priority queue holds 10 elements, as shown below. What values might be stored in array positions 7–9 so that the properties of a heap are satisfied?
![pq.items.elements Z [0] [1] [2] [3] [4] [5] [6] [7] [8] [9]](https://dsd5zvtm8ll6.cloudfront.net/images/question_images/1706/7/7/6/49465bb57ae0f0421706776493826.jpg)
pq.items.elements Z [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] F J E B G H ? ? ?
Step by Step Solution
3.52 Rating (162 Votes )
There are 3 Steps involved in it
The image illustrates an arraybased implementation of a heap data structure that is being used as a priority queue for characters sans duplicates To m... View full answer
Get step-by-step solutions from verified subject matter experts
