C++ implementation of a min priority queue using an array.Implement insert and deleteMin.
class MinPriorityQueue
{
public:
PQ(int cap=10);
void insert(int item);
int deleteMin();
private:
int cap;
int* data;
};
MinPriorityQueue::MinPriorityQueue(int cap)
{
size=0;
this->cap = cap;
data = new int[cap];
}
Answer