Picture an array bent into a ring: after its last cell, the next position is the first cell again. A circular queue uses this wraparound to reuse cells freed by dequeues, without shifting the remaining elements. Enqueue adds at the rear; dequeue removes from the front. section 9.7 section 9.18
Wraparound in an eight-cell array
With cells indexed 0 through 7, the virtual position after 7 is 8, which maps back to cell 0: 8 % 8 = 0. The same pattern maps virtual index 9 to cell 1. section 9.7
A static array has a fixed capacity, so enqueueing when it is full must be handled. A dynamic array can grow, but resizing requires rearranging elements so the front and rear positions still work. Array implementations can offer performance advantages when capacity is known, at the cost of more complicated code. section 9.7 section 9.13 section 9.9
