C Implementation Min Priority Queue Using Array Implement Insert Deletemin Class Minpriori Q37237617

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


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.