Queue (FIFO) visualizer

Enqueue at the rear, dequeue from the front — interactively.

  • Enqueue: O(1)
  • Dequeue: O(1)
  • Search: O(n)

Read the lesson: Queue (FIFO).

Other visualizers

  • Array techniques — Four patterns in one: two-pointer reverse, binary search, ternary search, and the sliding window.
  • Searching — Linear, binary and ternary search with custom arrays, target values, and live candidate windows.
  • Sorting — Bubble, insertion, selection, merge & quick sort — comparisons and swaps, live.
  • Recursion & backtracking — Custom call stacks, divide-and-conquer trees, and backtracking/pruning trees.
  • Linked list — Insert at head or tail, delete a value — see why access is O(n).
  • Stack (LIFO) — Push and pop from the top. Add your own values and watch it behave.
  • Queue (FIFO) — Enqueue at the rear, dequeue from the front — interactively.
  • Hash table — Insert keys with h(k)=k mod 7 and watch collisions chain.
  • Trees & BSTs — BST insert/search plus red-black recolors and rotations in one tree lab.
  • Heap / priority queue — Insert and extract-min on a min-heap — watch values sift up and down, with the backing array in sync.
  • Tree traversals — In-order, pre-order, post-order and level-order on one tree.
  • Pathfinding — BFS, DFS, Dijkstra & A* on a grid and a weighted node graph.
  • Sieve of Eratosthenes — Cross out composites: for each prime p, strike its multiples from p². What survives is prime.
  • Game theory (Nim / Grundy) — Subtraction game: compute Win/Lose positions and Grundy numbers bottom-up from the terminal state.
  • String pattern matching — Slide a pattern across text — naive vs KMP. Watch comparisons, mismatches, and KMP's failure-function skips.
  • Greedy algorithms — Three classics in one lab: activity selection (interval timeline), Kadane's max subarray, and fractional knapsack.
  • Bit manipulation — AND/OR/XOR/NOT, shifts, and the x & -x / x & (x-1) tricks — applied bit by bit on 8-bit binary with place values.
  • Dynamic programming — Watch a DP table fill cell by cell: coin change (1D), unique paths, and edit distance (2D), with dependencies highlighted.
  • Graph algorithms — One weighted-graph lab: shortest paths (Bellman-Ford/Floyd-Warshall), minimum spanning trees (Kruskal/Prim), and the union-find structure that powers Kruskal.