Open In App
Related Articles

ISRO | ISRO CS 2017 | Question 53

Improve Article
Improve
Save Article
Save
Like Article
Like

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.

Hence Option (C) is the correct answer.


Quiz of this Question
Please comment below if you find anything wrong in the above post

Last Updated : 15 Mar, 2018
Like Article
Save Article
Similar Reads