in DS closed by
1,290 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
in DS closed by
1.3k views

4 Comments

thank you bro, for correcting me...

Moreover see this question ( not answer ) https://gateoverflow.in/1826/gate2006-49

0
0

@Shaik Masthan isnt this question a bit ambiguous as we dont know how 1 2 3 4 is placed in the stack

0
0

@TUSHAR_BHATT

it is upto you that " How to use the stacks. just questioner mentioned that he/she has a queue. "

0
0

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

2 Comments

Plz explain?
0
0
My answer

push 9

Pop 6
0
0

Related questions