The following routine makes use of two queues: Q1, Q2, and one stack: 5. Initially the queue Q1 containers 2, 4, 6, 8, 0, 5, 9, 0, 7, 4, 1, 0, 1 from front to rear. What are the contents of queue Q2 from front to rear after the execution of the following function?

void myFunc1(  )

{

int i ;

while (!empty queue (Q1)) {

int x=dequeue (Q1, i)

if (ẋ = = 0)

{

while (!empty stack (5))

Enqueue (Q2, popstack (5));

}

else

pushstack (5, i);

}

}

1
8, 6, 4, 2, 0, 9, 5, 0, 1, 4, 7, 0, 1
2
8, 6, 4, 2, 9, 5, 1, 4, 7, 1
3
2, 4, 6, 0, 8, 5, 0, 9, 7, 4, 1, 0, 1
4
2, 4, 6, 8, 0, 5, 9, 0, 7, 4, 1, 0, 1

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation