04 Try it yourself Interactive
Press Next one step at a time. In the Circular queue tab the middle row is the array of 5 slots: emerald cells are owned by the queue, the amber cell was just written, the rose cell was just read out. The bottom row is where F and R are pointing — watch them jump from slot 4 to slot 0.
The Window maximum tab runs whichever list is loaded through a deque instead. The emerald cells in the deque row are the indices still in play, and the indigo one is its front — which is the window maximum on every row that reports one, but only after any index that has fallen out of the window has been dropped, so watch it be wrong for exactly one step before that drop happens.