Skip to content
DSA Visualizerpreview

Queue

Join at the rear, leave from the front: the first value in is the first value out.

O(1) per operation (amortised) time · O(n) space

Operations4, 9, 2, dequeue, 6, peek, dequeue

Start with an empty queue.

Empty queue.
  • compare
  • swap or write
  • settled

1 / 10

Speed

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