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]

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

1 Expert Approved Answer
Step: 1 Unlock

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

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 Programming Language Pragmatics Questions!