File - 884729453 - 1694060717 - Stack&queue 10 MCQ
File - 884729453 - 1694060717 - Stack&queue 10 MCQ
push(5)
since if you print pop, you can see the
push(8) deleted element. that is what 85251 is
pop
push(2)
push(5)
pop
pop
pop
push(1)
pop
Ans = a
Q2 Insertion and Deletion operation in Queue is known as ?
a) PUSH & POP
b) Enqueue and Dequeue
c) Insert and Delete
d) None
Ans = b)
Q3 Stack in Data Structure is ___________.
A) LIFO
B) FIFO
C) LEFO
D) FEFO
Ans: a)
Q4 In the stack, If user try to remove element from the empty stack then it called as
___________.
a) Empty Collection
b) Overflow of stack
c) Garbage Collection
d) Underflow of Stack
Ans =d
Q5 void fun(Queue *Q)
{
Stack S; // Say it creates an empty stack S
// Run while Q is not empty dequeues item from Q via fifo and puts into
stack in same order. but when popping
while (!isEmpty(Q)) from stack, lifo so order reversed when
reinputting into queue
{
// deQueue an item from Q and push the dequeued item to S
push(&S, deQueue(Q));
}
Ans = d)
Q6 Suppose a circular queue of capacity (n – 1) elements is implemented with an array of n
elements. Assume that the insertion and deletion operation are carried out using REAR and
FRONT as array index variables, respectively. Initially, REAR = FRONT = 0. The conditions to
detect queue full and queue empty are
Ans= a)
Q7 A data structure in which elements can be inserted or deleted at/from both the ends but
not in the middle is?
a) Queue
b) Circular queue
c) Dequeue
d) Priority queue
Ans= c)
Q8 If the elements “A”, “B”, “C” and “D” are placed in a queue and are deleted one at a time,
in what order will they be removed?
a) ABCD
b) DCBA
c) DCAB
d) ABDC
Ans= a)
d) Rear
Ans=c