Check circular-queue invariants

A circular queue stores requests in fixed slots and wraps an advancing index from the last slot back to slot 0. This implementation uses all four slots, numbered 0 through 3. The variable head identifies the next request to remove, tail identifies the next insertion slot, and count records the number of waiting requests. Each successful enqueue advances tail; each successful dequeue advances head. A rejected operation changes nothing.


Initially, head = 3, tail = 3, and count = 4. The physical storage is shown below. The initial logical order from front to rear is R7, R8, R9, R10.


Four physical slots hold R8, R9, R10, and R7, with index advancement wrapping from slot 3 to slot 0.


Select every correct statement. Evaluate each statement independently from this initial state. A full queue rejects an enqueue rather than overwriting a waiting request.

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Queues Questions: