LIFO and FIFO structures with pushes, pops, and wrap-around circular buffers.
9 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.
Pushes and pops at both ends while maintaining front/back links.
Uses a stable binary min-heap to enqueue and serve items by priority.
Finds every next-greater element by maintaining a decreasing stack of unresolved indices.
Implements FIFO behavior by transferring items between input and output stacks only when needed.