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++:


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
Get step-by-step solutions from verified subject matter experts
