AlgoScope

Circular Queue

Data structurebeginnerLinear Structuresalso called ring buffer

A fixed array where front and rear indices wrap around, so no space is wasted.

Decision · step 3 of 10Circular Queue: Rear wraps around
503123frontrear

enqueue 3 into slot 1, one past the old rear. Size 2.

Open in the player →or start at step 3

What you will see

A ring of slots; FRONT and REAR indices chase each other around the ring.

How circular queue works →

Cost

enqueueO(1)
dequeueO(1)
SpaceO(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.

Before this

Related