Open In App

GATE | GATE-CS-2004 | Question 36

Like Article
Like
Save
Share
Report

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?

circularLinkedList
(A) rear node
(B) front node
(C) not possible with a single pointer
(D) node next to front


Answer: (A)

Explanation: See https://www.geeksforgeeks.org/data-structures-linked-list-question-12/

Quiz of this Question


Last Updated : 28 Jun, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads