← CS 302 Home

Queues — Interactive

Enqueue values at the rear, dequeue from the front, and watch both circular array and linked-list representations update in sync. See how wrap-around works with modular arithmetic.

Normal
0
Size
8
Capacity
Front Index
Rear Index
Watch the circular array — when rear wraps past the end, that's modular arithmetic in action: rear = (rear + 1) % capacity
Circular Array (capacity 8)
Linked List
Filled
Front
Rear
Peek