MCQ1 mark
A queue is implemented using an array such that ENQUEUE and DEQUEUE operations are performed efficiently. Which one of the following statements is CORRECT ( refers to the number of items in the queue)?
Single correct
Answer key coming soon
GATE CSE previous year questions · Programming & Data Structures
Single correct
Answer key coming soon
while Q is not Empty do
if S is Empty OR Top(S) ≤ Head(Q) then
x := Dequeue(Q);
Push(S,x);
else
x := Pop(S);
Enqueue(Q,x);
end
end
The maximum possible number of iterations of the while loop in the algorithm is ________.Numerical answer
Answer key coming soon