Try the same model with your own values. No checks, nothing recorded.
The first picture is a stack of four cells, which doubles when it is full. The second is a queue in a ring of five cells, which never grows. Push and pop on the stack. Enqueue and dequeue on the ring, and watch head and tail go back to index 0 after the last cell. That is the work of % 5.
Run an operation to begin.
Run an operation to begin.
Values are whole numbers. The ring refuses an enqueue when the queue holds five values, so dequeue first. A cell with a line through it is stale: its value has left the queue.