11 11 votes The queue data structure is to be realized by using stack. The number of stacks needed would be It cannot be implemented 2 stacks 4 stacks 1 stack Data Structures isro2015 data-structures stack + – go_editor 5.9k views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
Best answer 11 11 votes The correct option is B. Pankaj kumar answered Jul 13, 2016 • selected Jun 28, 2017 by Kapil Pankaj kumar comment Share Follow See all 4 Comments 4 4 Comments reply shekhar chauhan commented Jul 13, 2016 reply Follow flag @pankaj kumaras you have written if we want to perform queue operation then we need to pop ...but actually for queuing you don't need to pop you just need to push the elements in stack A like push a then push b push c this is for queuing but for dequeuing you must pop them from stack A and push them into B now for dequeuing pop then one by one to maintain the queue order. 1 1 replyShare Pankaj kumar commented Jul 13, 2016 reply Follow flag you are right but the case is after insertion some element we want to remove an element from the queue and then again we want insertion that's why i did this. 0 0 replyShare Pankaj kumar commented Jul 13, 2016 reply Follow flag it will work for all the cases. 0 0 replyShare viral8702 commented Jun 24, 2023 reply Follow flag Here if asked that for enqueue purpose how many stacks will be required? Then answer will be 1 right? 0 0 replyShare Please log in or register to add a comment.
6 6 votes Answer is b) 2 stacks http://www.geeksforgeeks.org/implement-stack-using-queue/ Kapil answered Jun 17, 2016 Kapil comment Share Follow 0 reply Please log in or register to add a comment.