Skip to content
Related Articles

Related Articles

Algorithms Quiz | SP Contest 3 | Question 2
  • Last Updated : 25 Jul, 2018
GeeksforGeeks - Summer Carnival Banner

What is the minimum number of queues needed to implement a stack? We are not allowed to use any other data structure and also not allowed to use recursion. We may assume that given queue has basic functions like enqueue(), dequeue(), size(), isEmpty()
(A) 1
(B) 2
(C) 3
(D) 4


Answer: (A)

Explanation: https://www.geeksforgeeks.org/implement-a-stack-using-single-queue/

Quiz of this Question

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :