ISRO | ISRO CS 2017 | Question 53
The minimum number of stacks needed to implement a queue is
Two stacks S1 & S2 are required to implement a queue.
This method makes sure that newly entered element is always at the top of stack 1, so that DeQueue operation just pops from stack1. To put the element at top of stack1, stack2 is used.
Quiz of this Question
Please comment below if you find anything wrong in the above post
My Personal Notes arrow_drop_up
Please Login to comment...