Queue: GATE CS Previous Year Questions

Queue · Data Structures

14 questions · asked in 13 of 27 years (2000–2026)

MCQ 9 · MSQ 1 · NAT 41-mark 7 · 2-mark 7

2000Questions per year2026

Questions 6–10 of 14

Q6GATE 2017 (Session 2)1 markMCQ−0.33 if wrong
A circular queue has been implemented using a single linked list where each node consists of a value and a single pointer pointing to the next node. We maintain exactly two external pointers FRONT and REAR pointing to the front node and the rear node of the queue, respectively. Which of the following statements is/are CORRECT for such a circular queue, so that insertion and deletion operation can be performed in O (1) time ?

I. Next pointer of front node points to the rear node.
II. Next pointer of rear node points to the front node.

Q7GATE 2016 (Session 1)1 markMCQ−0.33 if wrong
A queue is implemented using an array such that ENQUEUE and DEQUEUE operations are performed efficiently. Which one of the following statements is CORRECT (n refers to the number of items in the queue)?

Q8GATE 2016 (Session 1)2 marksNAT
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_________.

Q9GATE 2014 (Session 2)2 marksMCQ−0.67 if wrong
Suppose a stack implementation supports an instruction REVERSE, which reverses the order of elements on the stack, in addition to the PUSH and POP instructions. Which one of the following statements is TRUE with respect to this modified stack?

Q10GATE 20132 marksMCQ−0.67 if wrong
Consider the following operation along with Enqueue and Dequeue operations on queues, where k is a global parameter.
 MultiDequeue(Q){
m = k
while (Q is not empty) and (m > 0) {
   Dequeue(Q)
   m = m - 1
   }
} 
What is the worst case time complexity of a sequence of n queue operations on an initially empty queue?

Keep practising

Topics in Data Structures

All CS topics ›