GATE CS 2017 · Set-2 · Asymptotic Analysis & Recurrences

MCQ · 1 mark · Problem PROG-DIVC-0180

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.
  1. A
    I only
  2. B
    II only
  3. C
    Both I and II
  4. D
    Neither I nor II

Solve it on GATE DA practice →More Searching & Sorting Algorithms problems

Show the worked solutionOfficial GATE Answer Key: Option B.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/118253/gate2017-2-13

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