GATE CSE 2017 Session 2 Q23: Circular queue as singly linked list with FRONT and REAR pointers
- Programming and Data Structures
- 1 mark
- MCQ
- −1/3 if wrong
Syllabus topic: Arrays, stacks, queues and linked lists
Question
A circular queue has been implemented using a singly 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 operations can be performed in time?
I. Next pointer of front node points to the rear node. II. Next pointer of rear node points to the front node.
Try it: multiple choice: exactly one correct option
Show answer and explanation
Answer: B (official GATE 2017 final answer key)
Concept used: In a circular singly linked queue the list runs front to rear and the rear node links back to the front, so both ends are reachable in constant time.
First step: Trace how a node is inserted at REAR and removed at FRONT, and see which next pointer each operation needs.
Full step-by-step solution
Loading…
Answer from the official final answer key. Found a mistake? Use Report issue and we will fix it.
More questions on Arrays, stacks, queues and linked lists
Every PYQ on this topic →Share this question
Source: official GATE 2017 Session 2 CS question paper and final answer key, organised by IIT Roorkee. Question paper · Answer key
More Programming and Data Structures PYQs
- 2026 Session 1 · Q23Non-leaf indices in a 1-indexed binary heap with n odd
- 2026 Session 1 · Q24Empty slots after linear-probing inserts with h(x) = (x+7) mod 11
- 2026 Session 1 · Q33Maximum height of a full binary tree with 23 nodes
- 2026 Session 1 · Q34Output of a C function with a shadowed block variable
- 2026 Session 1 · Q39Recursive length of a non-empty singly linked list
- 2026 Session 1 · Q40Third insertion that can never yield a complete BST of 1..15