Bornat Visualizer
AlgorithmsData StructuresNeural NetPracticePlaygroundCompareDocs

Stacks & Queues

LIFO and FIFO structures with pushes, pops, and wrap-around circular buffers.

9 visualizations

Compare

Stack (LIFO)

A last-in-first-out structure supporting push, pop, and peek — each in O(1).

BeginnerstackLIFO

Queue (FIFO)

A first-in-first-out structure supporting enqueue at the rear and dequeue from the front in O(1).

BeginnerqueueFIFO

Balanced Parentheses

Uses a stack to verify that every opening bracket has a correctly ordered matching closing bracket.

Beginnerstackmatching

Min-Stack (O(1) minimum)

A stack that also returns its minimum in O(1) by caching a running minimum with every pushed value.

Intermediatestackdesign

Circular Queue (Ring Buffer)

A fixed-size queue whose front and rear indices wrap around with modulo arithmetic, reusing freed slots.

Intermediatequeuering buffer

Deque Operations

Pushes and pops at both ends while maintaining front/back links.

Beginnerdequedouble ended queue

Priority Queue

Uses a stable binary min-heap to enqueue and serve items by priority.

Intermediatepriority queuebinary heap

Monotonic Stack

Finds every next-greater element by maintaining a decreasing stack of unresolved indices.

Intermediatestacknext greater element

Queue Using Two Stacks

Implements FIFO behavior by transferring items between input and output stacks only when needed.

Intermediatequeuetwo stacks
Bornat Data Structure Visualizer

Learn, visualize, experiment, and master data structures & algorithms with fully interactive, step-by-step animations.

Made with by Jibreel Bornat

Computer Engineering — Birzeit University

Explore

  • Sorting
  • Searching
  • Linked Lists
  • Stacks & Queues
  • Hashing
  • Trees
  • Graphs

App

  • All Algorithms
  • Practice
  • Playground
  • Documentation
  • About
  • Settings
Bornat Data Structure Visualizer© All Rights Reserved