Implementing a Queue using stacks!? That's just craziness. A Stack is a LIFO structure - last in first out, while a Queue is a FIFO structure - first in first out. They're completely different.
I guess the biggest thing to do is insert. In order to do that, you'd take the following steps:
1) Declare an array of stack nodes with size equal to the stack's size.
2) From 0 to size - 1, pop each node of the stack and set the nodeArray at the position to the node. For example:
- nodeArray[0] = PQ.pop();
-
nodeArray[1] = PQ.pop();
Of course, you'd use a for... loop for this.
3) The stack is now empty. Add the node given to the function as a parameter to the stack.
4) Finally, traverse your node array backwards, inserting each node onto the stack again.
That would be a generic queue insert function - doing it this way means that the function to get the first node in the queue would be the same as the stack.pop() function.
Of course, I'm not all too familiar with priority queues - you may have to insert the extra node somewhere in the array based on its priority. That would have to happen between steps 2 and 3.
Good luck!