Deque (circular buffer, both ends)
A ring buffer with two moving ends: add or remove at the front or the back in O(1).
Operationspush 4, push 7, unshift 2, unshift 9, pop, shift, push 5, unshift 1
An empty ring of 8. push and pop work at the back; unshift and shift at the front.
- compare
- swap or write
- settled
Space play · ← → step · Home End jump · drag the strip to scrub