in DS edited by
472 views
0 votes
0 votes

An implementation of a queue Q, using two stacks S1and S2, is given below:

 

The number Push and Pop operation needed is represented by X and Y, then the value of X + Y for following operation are ________.

 

in DS edited by
472 views

4 Comments

Add this :

 

1
1

17 ..

1
1
This should be the best answer!
–1
–1

syncronizing Thank you :p  I did not make it make it an answer because it was looking dull(the pic quality) hehe :p

0
0

1 Answer

0 votes
0 votes
Best answer

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Now Simply add total PUSH and POP operation.
PUSH = 9
POP = 8
hence, 17 is the answer.

Answer by @MiNiPanda

1 comment

Sorry for Alignment issue :P
0
0

Related questions