CSE220 · Data Structures

Circular Queue (ADT) Simulator

See exactly when front and rear wrap around, and how full is told apart from empty.

Empty circular queue with room for 6. front and rear wrap around the array.

step 1 of 4
touched this stepholds a valuefree slot

Operations

Changing capacity clears the structure.

State

size
0 / 6
front
-1
rear
-1
operations
3 / 60

front and rear advance modulo the capacity. Fill it, dequeue twice, then enqueue twice more and watch rear wrap around to index 0.

← → to step, or use the buttons above.