GATE CS 2016,Set-1,Q41:Let Q denote a queue containing sixteen numbers and S be an empty stack.Head
Автор: Monalisa CS
Загружено: 2020-07-23
Просмотров: 3521
Описание:
GATE CS 2016,Set-1,Q41: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 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.
Ans:256
Ch -2.3:Queues | Linear Queue, Circular Queue • Ch-2.3:Linear Queue, Circular Queue | Data...
Ch-2.2:Stack | Recursion, Tower Of Hanoi • Ch-2.2:Recursion, Tower Of Hanoi(TOH) | Da...
Ch-2.1:Stack permutation , Infix,Prefix,Postfix expression • Ch-2.1:Stack permutation , Infix,Prefix,Po...
---------------------------------------------------
Subscribe my channel for more updates / monalisacs
----------------------------------------------------------
Join Telegram GATE CS study group: https://t.me/MonalisaCS
----------------------------------------------------------------
Compiler Design Lectures : • Ch 1.1:Language Processing System |CD Lect...
----------------------------------------------------------------
Compiler Design PYQ : • Ch 1.1:Language Processing System |CD Lect...
----------------------------------------------------------------------
Theory Of Computation Lectures • Видео
-------------------------------------------------------------------
TOC GATE PYQ: • GATE CS 2010,Q39:Let L={w ∈ (0 + 1)* | w h...
-------------------------------------------------------------------
Data Structure Lecture: • Data Structure Syllabus for GATE
---------------------------------------------------------------------
Data Structure PYQ: • Data Structure Syllabus for GATE
-----------------------------------------------------------------------
#Queue#GATECS2016#stack
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: