Let Q denote a queue containing sixteen numbers and S be an empty stack.…

GATE · 2016 · CS · Set 1 · Computer Science & IT

Let Q denote a queue containing sixteen numbers and S be an empty stack.  Head(Q) returns the element at the head of the queue Q without removing it from Q. Similarly, Top(S) returns the element at the top of S without removing it from S. Consider the algorithm given below.

The maximum possible number of iterations of the while loop in the algorithm is ___________ .

Attempted by 203 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…