Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

ISRO | ISRO CS 2017 | Question 53

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

The minimum number of stacks needed to implement a queue is

(A)

3

(B)

1

(C)

2

(D)

4


Answer: (C)

Explanation:

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
Last Updated : 15 Mar, 2018
Like Article
Save Article
Similar Reads