How do implement Queue using Stack and Stack using Queue
Software QA/Tests Interview Questions from Microsoft
(Continued from previous question...)
How do implement Queue using Stack and Stack using Queue
Question:
How do implement Queue using Stack and Stack using Queue
maybe an answer:
Let N be the size of the Queue
Push: Enqueue the element at the back of the queue
Pop: Dequeue N-1 elements and immediately Enqueue them at the end of the Queue
Dequeue the last(Nth) element
(Continued on next question...)
Other Interview Questions
|