Practice mode Data Structures

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

Explanation

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.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.