I have code that I am strugling to write could u plz help me with it ...I 'll be thankfull
Implement a Priority Queue using Stacks. I am not allowed to use any other data structure. Example:
Class PriorityQueue
{
Stack PQ;
…
….
}
I should implement the following interface:
Public void insert (double data, int priority) {}
Public double remove () { }
Public boolean is-empty() { }
Public double peekmin() {}
Public int size () {}
Public remove (int n) { } // remove the element number n
Implement a Priority Queue using Stacks. I am not allowed to use any other data structure. Example:
Class PriorityQueue
{
Stack PQ;
…
….
}
I should implement the following interface:
Public void insert (double data, int priority) {}
Public double remove () { }
Public boolean is-empty() { }
Public double peekmin() {}
Public int size () {}
Public remove (int n) { } // remove the element number n
Comment