Solution (source code)

= Solution

The successive abstract <sequences> are $[10]$, $[20,10]$, $[20,10,30]$, $[10,30]$, $[10,30,40]$, $[10,30,40,10]$, $[10,30,40]$, $[10,30,40,15]$, and finally $[30,40,15]$. The three removals return $20$, $10$, and $10$, respectively. With the display convention in part (i), \b[the output is]
``
20
10
10
Queue status: [30, 40, 15]
``
The capacity-four bound is never exceeded. The abstract trace is independent of which physical <array> slots wrap around.