edited by
313 views

1 Answer

0 votes
0 votes

considering the stack : 1,0,2,4,5,7 with top = 7

queue 1 : 3,6,7,8,9,0 with front as 3 and rear as 0.

now as we know that   :-> stack : lifo    queue : fifo

1st case : x=7 , y = 3 ==> x=x+y =10

so now queue1=6,7,8,9,0,10 ans queue 2 = 3,

similarly we will execute the while loop since stack is empty.

which gives out..

queue 1 : 10,11,11,10,9,1

queue 2 : 3,6,7,8,9,0

so answer is A

 

Related questions

2 votes
2 votes
1 answer
1
1 votes
1 votes
1 answer
2
Kalpataru Bose asked Jan 19, 2018
443 views
Can someone explain the solution along with a picture of how the steps are taking place?
1 votes
1 votes
0 answers
4