Gate CS-2017-2 Question Paper With Solutions

Q. 30 A Circular queue has been implemented using singly linked list where each node consists of a value and a pointer to next node. We maintain exactly two pointers FRONT and REAR pointing to the front node and rear node of queue. Which of the following statements is/are correct for circular queue so that insertion and deletion operations can be performed in O(1) i.e. constant time.

I. Next pointer of front node points to the rear node.
II. Next pointer of rear node points to the front node.

(A) I only

(B) II only

(C) Both I and II

(D) Neither I nor II

Answer: (B)

Explanation:

Gate CS-2017-2 Question Paper With Solutions

Learn More:   CS-2002 Question Paper With Solutions

LEAVE A REPLY

Please enter your comment!
Please enter your name here