Skip to content
Related Articles

Related Articles

Improve Article

Data Structures | Queue | Question 3

  • Last Updated : 01 Feb, 2013

How many stacks are needed to implement a queue. Consider the situation where no other data structure like arrays, linked list is available to you.
(A) 1
(B) 2
(C) 3
(D) 4

Answer: (B)

Explanation: A queue can be implemented using two stacks. See following for implementation.

My Personal Notes arrow_drop_up
Recommended Articles
Page :