Circular Queue
A fixed array where front and rear indices wrap around, so no space is wasted.
Decision · step 3 of 10Circular Queue: Rear wraps around
enqueue 3 into slot 1, one past the old rear. Size 2.
What you will see
A ring of slots; FRONT and REAR indices chase each other around the ring.
Cost
| enqueue | O(1) |
|---|---|
| dequeue | O(1) |
| Space | O(capacity) |
How you work with it here
play it through, step one change at a time, scrub to any step, run it on your own input, try operations in any order.
Screen readers: Each element is an accessibility element with position, value and state; structural changes are announced per step.
Reduced motion: Elements appear at their destination with a crossfade; no travel longer than the element's own size.