Question
Implement a Priority Queue with an unsorted list to store data. Please fill in the following member functions and create the necessary classes to utilize
Implement a Priority Queue with an unsorted list to store data. Please fill in the following member functions and create the necessary classes to utilize a list. Do not add extra member functions to the priority queue class listed below, just fill them in and add separate classes for list implementation. Remember that the list is unsorted. Everything should be done in compilable C++ code.
template
class PriorityQueue
{
private:
// data here
public:
PriorityQueue(void);
// Performs an insertion of "n" items from dataArray into the priority queue
PriorityQueue ( Type *dataArray, int n ){};
~PriorityQueue(void){};
bool isEmpty(void){};
int size(void){};
// inserts a piece of data into the priority queue
void insertItem ( Type data ){};
// removes and returns the minimum value in the queue
// throws an exception if the queue is empty
Type removeMin ( void ) throw(exception);
// return the minimum value in the queue without removing it
// throws an exception if the queue is empty
Type minValue ( void ) throw(exception);
};
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