Skip to content
DSA Visualizerpreview

Circular buffer (ring queue)

A queue in a fixed ring of slots: head and tail chase each other round, and nothing ever moves.

O(1) per operation time · O(capacity) space

Operations1, 2, 3, 4, dequeue, dequeue, 5, 6, 7, 8

An empty ring of 6 slots.

Ring of 6; 0 values from head: none.
  • compare
  • swap or write
  • settled

1 / 13

Speed

Space play · ← → step · Home End jump · drag the strip to scrub