Similar questions 1 more →
Stacks & Queues

Answer & solution
Official answer: B
1. For queue order to follow next links, the circular chain must run FRONT → second → ... → REAR → FRONT. Its closing link is therefore REAR.next=FRONT, statement II.
2. To enqueue node u, set u.next=FRONT, REAR.next=u and REAR=u. To dequeue, save the old front, advance FRONT=FRONT.next and set REAR.next=FRONT. Both require only a fixed number of pointer changes, with empty and singleton cases handled separately.
3. If links instead run backward through queue order, removing the front would require finding its predecessor by traversal. Statement I is not the general rule, even though both statements happen to hold in a two-node circle. Choose B.