GATE CS 2004 · Arrays & Matrix Representation

MCQ · 1 mark · Problem PROG-DSTR-0237

A circularly linked list is used to represent a Queue. A single variable p is used to access the Queue. To which node should p point such that both the operations enQueue and deQueue can be performed in constant time?
  1. A
    rear node
  2. B
    not possible with a single pointer
  3. C
    front node
  4. D
    node next to front

Solve it on GATE DA practice →More Basic Data Structures problems

Show the worked solutionOfficial GATE Answer Key: Option A.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/1033/gate2004-36

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com