3 votes 3 votes What are the minimum enqueue and dequeue operations needed to perform pop operation for a stack which is implemented with two queues if there are already 10 elements in the first queue? DS data-structures stack queue + – Ibtisam Sayyad asked Jan 12, 2018 Ibtisam Sayyad 7.9k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
1 votes 1 votes If we wand to delete 1 element from stack .then we need to perfome 9EQ and 10 DQ OPERATION. abhishekmehta4u answered May 15, 2018 abhishekmehta4u comment Share Follow See 1 comment See all 1 1 comment reply sathvikchiramana commented Jul 18, 2018 reply Follow Share I think no of enqueues and dequeues required are 0 and 1 because let's assume our stack is push operation costly instead of pop operation costly then we get 0 and 1 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes No. of Enqueue and dequeue operations will be 9 and 10 respectively. VipulSingh890 answered May 14, 2018 VipulSingh890 comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes to pop 1 element from stack we have 10 dequeue and 9 enqueue. Similarly for popping subsequent elements from stack the series become DEQUEUE- 10+9+8+7+6+5+4+3+2+1= 55 dequeues ENQUEUE- 9+8+7+6+5+4+3+2+1+0= 45 enqueues rish1602 answered Feb 5, 2021 rish1602 comment Share Follow See all 0 reply Please log in or register to add a comment.