LIFO and FIFO structures with pushes, pops, and wrap-around circular buffers.
5 visualizations
A last-in-first-out structure supporting push, pop, and peek — each in O(1).
A first-in-first-out structure supporting enqueue at the rear and dequeue from the front in O(1).
Uses a stack to verify that every opening bracket has a correctly ordered matching closing bracket.
A stack that also returns its minimum in O(1) by caching a running minimum with every pushed value.
A fixed-size queue whose front and rear indices wrap around with modulo arithmetic, reusing freed slots.