Modulo arithmetic uses the remainder after division to map a continuing sequence back onto a fixed set of positions. In a circular queue, this lets virtual indexes wrap from an array’s end to its beginning. section 9.7
Wrapping an eight-element array
For an array indexed from 0 to 7, 8 % 8 equals 0, 9 % 8 equals 1, and 10 % 8 equals 2. Thus, virtual index 8 refers to array index 0, allowing the rear pointer to continue after the array’s end. section 9.7


