Why is a circular queue preferred over a simple linear array queue?
Correct answer D. It reuses array slots freed by dequeues, so space at the front is not wasted
In a linear array queue, rear only moves forward, so after several dequeues the queue may report full even though the slots at the front are empty. A circular queue wraps the indices round using modulo arithmetic, so freed slots are reused. It still needs both front and rear indices and does not sort or allow removal from the middle.
Answer checked How we write and check questions
Discussion