Question: Implement a Priority Queue with an array-based implementation of a heap to store data. Please fill in the following member functions and create the necessary
Implement a Priority Queue with an array-based implementation of a heap to store data. Please fill in the following member functions and create the necessary classes to utilize an array-based heap. Do not add extra member functions to the priority queue class listed below, just fill them in and add separate classes for array heap implementation.. 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
Get step-by-step solutions from verified subject matter experts
