Let Q be a queue and S be a stack. Assume that Q and S are initially empty. What is the last integer value printed by the following code?

Enqueue(Q,8);

Enqueue(Q,3);

Push(S,7);

Push(S,9);

For(i=0;i<5;i++)

{

Printf(ā€œ%dā€,Dequeue(Q));

Printf(ā€œ%dā€,Pop(S));

Enqueue(Q,i);

Push(S, i+5);

}

1
2
2
8
3
3
4
9

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation