Question No. 17 of 20 1 Marks
256
DE LEE
64
en
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.
while is not Empty do
if Sis Empty OR Top(S) < Head(b) then
x:= Dequeue (Q);
Push(S,x);
else
x= Pop(S);
Enqueue (Q,x);
end
ES
O 16
IE
E
BO
Elle
32
end
Next Qui
The maximum possible number of iterations of the while loop in the algorithm is__17 of 21
Answers
Answered by
3
Answer:
Explanation:
Let Q denote a queue containing sixteen numbers and S be an empty stack
Similar questions
Math,
1 month ago
Chemistry,
1 month ago
Social Sciences,
2 months ago
English,
2 months ago
Math,
10 months ago
Science,
10 months ago
Political Science,
10 months ago