When a circular queue is implemented in an array, then which of the following…
2018
When a circular queue is implemented in an array, then which of the following condition holds when there is only one element in the queue?
- A.
Front = Rear = null
- B.
Front = Rear ≠ null
- C.
Front = Rear + 1
- D.
Front = Rear − 1
Attempted by 1028 students.
Show answer & explanation
Correct answer: B
Explanation: When there is only one element in a circular queue implemented using an array, both Front and Rear refer to the same array index and are not null. Therefore, Front = Rear ≠ null. Key point: A single-element queue has Front and Rear pointing to the same position.