Programming and Data Structures · Linked Lists · 1 mark · Multiple choice
A circular queue uses a singly linked list, with value and next-pointer per node and exactly two external pointers FRONT and REAR. For O(1) insertion and deletion, which is correct? I: FRONT.next points to REAR. II: REAR.next points to FRONT.
Rear.next must point to the front to complete the circular chain. Enqueue inserts after rear and updates rear; dequeue removes front and updates rear.next, each in constant time. Front.next normally points to the second node, not rear. Only II, B.
More Linked Lists questions
GATE 2010 CS (CS1) Q46– For a singly linked list with at least two nodes, fill the blank to move its last node to…