Queue (ADT) Simulator
Enqueue and dequeue while front and rear move independently down the array.
·
0·
1·
2·
3·
4·
5Empty linear queue with room for 6. front and rear both start at -1.
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
Watch what happens if you enqueue to the end, dequeue a few, then enqueue again: it reports full even though slots are free. That wasted space is the whole reason circular queues exist.
← → to step, or use the buttons above.