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
Physics,
5 hours ago
Science,
5 hours ago
Geography,
5 hours ago
Social Sciences,
10 hours ago
English,
10 hours ago
Math,
7 months ago
Science,
7 months ago
Political Science,
7 months ago