Question: In c++: 2. Programming exercise. Implement a priority queue class based on a sorted array. (20 pts.) Details and suggestions You may assume that the

In c++:

In c++: 2. Programming exercise. Implement a priority queue class based on

a sorted array. (20 pts.) Details and suggestions You may assume that

2. Programming exercise. Implement a priority queue class based on a sorted array. (20 pts.) Details and suggestions You may assume that the priority queue (and hence, array) size is at most 100 You may assume that the keys are integers and the values are single characters. I suggest creating a class called Pair that contains an int as key and a char as value. Your priority queue needs to keep track of the last position used in the array. Provide an implementation of your algorithm in a file called SortedArrayPQ.cpp The main function should demonstrate the functionalitv on several test cases Test case: perform the following operations, showing the state of the priority queue each time. insert(5.a) insert (4,b) nsert (7,i) insert(1.d) removeMin insert (3,j) insert (6.c) removeMin() removeMin() insert(8,g)

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!