Question: Need help completing the Enqueue, Dequeue, DisplayQueue, and FindNode method of the priority queue program below class Node { public: int priority; int data_value; Node*

Need help completing the Enqueue, Dequeue, DisplayQueue, and FindNode method of the priority queue program below

class Node {

public:

int priority;

int data_value;

Node* next;

};

class PriorityQueue{

public:

PriorityQueue(void) { head = NULL; } // constructor

~PriorityQueue(void); // destructor

bool IsEmpty() { return head == NULL; }

void Enqueue(int priority, int value)

// insert new node in priority queue

{}

Node* Dequeue()

// Dequeue first node from the Queue and return it

{}

void DisplayQueue(void)

// DisplayQueue

{}

int FindNode (int priority, int value)

// Return the index/position where a node with priority and value located in the Queue

{}

private:

Node* head;

};

int main ()

{

PriorityQueue P;

P.Enqueue(1,10);

P.Enqueue(1,12);

P.Enqueue(2,5);

P.Enqueue(2,4); P.Enqueue(3,5);

P.Enqueue(2,1);

P.DisplayQueue();

P.Dequeue();

P.Dequeue();

P.DisplayQueue();

return 0;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!