Data Structures | Queue | Question 4

How many queues are needed to implement a stack. 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 stack can be implemented using two queues. Please see following for details.

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






Practice Tags :

Recommended Posts:



0 Average Difficulty : 0/5.0
No votes yet.