An optimized queue implementation utilizing a fixed-size ring buffer where the final position wraps around to connect directly with the first position, eliminating memory wastage.
Standard array queues suffer from false-overflow (empty slots preceding front cannot be reused).
Circular queues resolve this by advancing pointers via modulo arithmetic: rear = (rear + 1) % capacity.
When the rear index reaches the end of the array, the next insertion is placed at index 0 (provided it is not occupied by front).
Unlike linear queues where dequeued positions are inaccessible, circular queues reuse all vacated slots automatically.
Distinguished by maintaining a size counter or reserving front == -1 for empty and (rear + 1) % size == front for full.
Widely utilized in hardware drivers, audio streams, circular log buffers, and continuous sensor streaming architectures.