closed by
1,212 views
0 votes
0 votes
closed as a duplicate of: #Push & #Pop
A queue is implemented using two stacks S1 and S2. Initially the queue contains 1, 2, 3, 4 from front

to rear. The following operations are performed in the queue: delete, insert (5), delete, Then how

many total no. of push and pop operations are needed to perform the above operation?

 

a) Push: 12 Pop: 13

b) Push: 15 Pop: 16

c) Push: 11 Pop: 10

d) Push: 12 Pop: 11
closed by

1 Answer

0 votes
0 votes
option B is correct

push: 3+1+4+4+3 = 15

pop: 4+1+3+1+4+3 = 16

Related questions

2 votes
2 votes
2 answers
2
jatin khachane 1 asked Dec 1, 2018
1,226 views
My doubt : What should we consider ^ operator as Bitwise XOR ? or Exponentiation