Watch elements bubble up as adjacent pairs are compared and swapped. Tracks comparisons and swaps in real time with color-coded bars.
โฑ Animated
๐ Speed control
๐ Stats
View โ
Step through the divide-and-conquer search strategy. See the search range narrow with each comparison until the target is found.
โฑ Animated
๐ฏ Interactive
๐ Step counter
View โ
Paint walls, set start/end, and watch BFS flood-fill the grid. Frontier expands in orange, explored cells turn blue, path lights up yellow.
๐ฑ Draw walls
๐ฃ Path tracing
๐ข Step mode
View โ
Watch pivot selection and partitioning recurse through the array. Red pivot, blue/green pointers converge as the array is divided and conquered.
โฑ Animated
๐ Recursion depth
๐ vs Bubble sort
View โ
Conway's cellular automaton on a 60ร60 grid. Load classic patterns (Glider, Pulsar, R-pentomino) or draw your own and watch life emerge.
๐ฑ Draw cells
๐ฎ Patterns
โฑ 1-60 FPS
View โ
Insert and delete values in a self-balancing BST. Replay single and double rotations frame by frame while every node shows its height and balance factor.
๐ Single + double rotations
โฏ Replay controls
๐ Height + BF
View โ
See all-pairs shortest paths emerge as the distance matrix updates. The current pivot node, matrix cell, and best path on the graph stay synchronized step by step.
๐ Matrix state
๐งญ Path highlight
โฏ Step replay
View โ
Compare Kahn's queue-based algorithm and DFS topological order on the same DAG. Watch edge removal, recursion, and output order side by side.
โ Side by side
๐ Queue vs stack
๐จ Order coloring
View โ
Inspect range sum queries, point updates, and lazy propagation on a full segment tree. The array and tree stay linked so every covered interval is visible.
โ Lazy tags
๐ Update path
๐ฆ Segment combine
View โ
Build a maze on a 20ร20 grid, place start and end points, then watch Dijkstra expand the frontier and trace the shortest path step by step.
๐งฑ Toggle walls
โฑ Speed control
๐ Path length
View โ
See heap sort in its two distinct phases: building the max heap and extracting the maximum into the sorted suffix, with pause and resume controls.
โฏ Pause/resume
๐ 40 bars
๐ฃ Step counter
View โ
Build your own graph, then compare breadth-first and depth-first traversal on the same node set. Queue and stack contents update live as the run advances.
๐ฑ Add nodes
๐ Drag to connect
๐ Queue vs stack
View โ
Watch three hash functions map words into a compact bit array. Test words to see true negatives, true positives, and occasional false positives.
๐ฃ Word input
๐ฏ Hash animation
๐ FPR stats
View โ
Replay insert and delete fix-up step by step. Watch red-black color flips, left/right rotations, search paths, and all five invariants stay in sync.
๐ Rotation replay
๐จ Color flips
โ
5 properties
View โ
Watch divide and conquer in action. The array splits recursively, then merges back in sorted order with color-coded split and merge phases.
โฏ Auto / step
๐ Split & merge
๐ Stats
View โ
Draw walls on a 20ร20 grid, set start and end points, and watch A* use Manhattan distance heuristic to find the shortest path efficiently.
๐ฑ Draw walls
๐งญ Heuristic
๐ฃ Path tracing
View โ
Layered linked list with fast-lane skipping. Watch coin-flip level promotion during insert and express-lane traversal during search.
๐ฒ Coin flips
๐ Fast search
๐ Comparisons
View โ
Prefix tree that stores words character by character. Type to insert words, search highlights paths, and prefix matches update in real time.
โจ๏ธ Type to add
๐ Prefix search
๐ Word count
View โ
Build the suffix array round by round with prefix doubling. Rank pairs, sorted suffixes, and the final LCP array stay synchronized through every phase.
๐งฉ Rank pairs
โฏ Phase replay
๐ SA + LCP
View โ
2D spatial partitioning with alternating X/Y splits shown as colored lines. Click to add points, toggle NN mode to find nearest neighbors.
๐ฑ Click to add
๐ Nearest neighbor
๐จ Split planes
View โ
Order-4 B-tree with search, insertion, and deletion. Watch keys split upward on insert and merge or borrow during delete to maintain balance.
๐ Split/merge
๐ Search path
โฏ Step replay
View โ
Visualize `get` and `put` on an LRU cache backed by a doubly linked list and hash map. Tail eviction makes the least-recent item disappear on overflow.
๐ Hash map
โ DLL order
๐งน Eviction
View โ
See disjoint sets merge with union by rank and flatten with path compression. Parent pointers update live after each find and union.
๐ฒ Forest view
๐ Compression
๐งฉ Components
View โ
Sort edges by weight, then use Union-Find to grow a minimum spanning tree. Accepted edges turn green, rejected cycle edges flash red.
๐ Sorted edges
๐ชข DSU
โ MST weight
View โ
Find maximum flow from source to sink by repeatedly discovering augmenting paths through a residual graph. Compare BFS (Edmonds-Karp) vs DFS strategies on multiple graphs.
๐ Augmenting paths
โฉ๏ธ Residual graph
๐ช Min-cut
View โ
Follow repeated edge relaxations on a directed weighted graph, including negative edges and the extra pass that exposes reachable negative cycles.
๐ Passes
โ Negative edges
๐จ Cycle detect
View โ
Inspect prefix sums in a Binary Indexed Tree. Updates climb upward with `lowbit`, while queries hop downward and accumulate contributing cells.
โ Point update
โ Prefix query
๐ข lowbit
View โ
Watch numbers distribute into buckets digit by digit. Non-comparative sorting that processes ones, tens, hundreds โ until the array is sorted.
๐ชฃ 10 buckets
๐ข Digit highlight
๐ O(dรn)
View โ
Watch an LCS dynamic programming table fill cell by cell, then backtrack to recover one longest common subsequence through the finished grid.
๐ DP table
โ Backtracking
โจ๏ธ Custom strings
View โ
Non-comparative linear-time sort for bounded integers. Watch elements get counted, positions cumulated, then placed into sorted output.
๐ Count array
โ Cumulative
๐ฆ O(n+k)
View โ
Pick up each element and slide it left past all larger values, growing a sorted prefix one card at a time.
โฑ Animated
๐ฏ Key element
๐ Shift count
View โ
Insertion sort with a shrinking gap. Knuth's 3h+1 sequence pre-sorts distant elements so the final gap-1 pass is nearly free.
๐ข Gap sequence
๐ชฃ Bucket groups
๐ Shifts & comps
View โ
Grow a minimum spanning tree one vertex at a time. A min-heap tracks the cheapest crossing edge; green nodes join the MST, yellow shows the active frontier.
โ Min-heap
๐ฟ Greedy cut
๐ MST weight
View โ
Find all Strongly Connected Components in a directed graph with a single DFS. Watch disc/low values propagate and the stack pop entire SCCs at once.
๐ DFS stack
๐ข disc/low
๐งฉ SCC roots
View โ
Find bridges and articulation points in an undirected graph via DFS. Watch disc/low values update, tree vs back edges distinguished, bridges glow red and cut-vertices turn gold.
๐ข disc/low
๐ bridges
๐ cut-vertices
View โ
Graham Scan vs Jarvis March side by side. Click to add points and watch two algorithms race to wrap the smallest convex polygon around them.
๐ฑ Click to add
โ Side by side
๐ Step count
View โ
Insert, search, and delete keys while the djb2 hash function maps them to buckets. Toggle between Separate Chaining and Open Addressing (linear probe) to see how each strategy resolves collisions.
โ Chaining
๐ Linear probe
๐ Load factor
View โ
Count character frequencies, greedily merge the two lightest nodes, then walk the finished prefix tree to generate the optimal Huffman code table.
๐ Frequency bars
๐ฒ Tree build
0101 Code table
View โ
Every insert, search, and delete splays the touched node toward the root. Replay zig, zig-zig, and zig-zag rotations to see how locality reshapes the BST over time.
๐ Self-adjusting
๐ Rotation replay
๐ Access path
View โ
A randomized BST that also obeys heap order on priorities. Watch inserts bubble upward, deletes rotate downward, and both invariants stay visible frame by frame.
๐ฏ Path highlight
๐ Rotation replay
๐ฒ Random priorities
View โ
Insert points into a 2D quadtree, then switch to range query or nearest-neighbor mode to watch recursive subdivision and bounding-box pruning cut away most of the search space.
๐ฑ Spatial insert
โฌ Range query
๐ฏ NN pruning
View โ
Sliding-window compression step by step. Watch the search buffer and lookahead buffer scan the input, find back-references, and emit (offset, length, char) tokens.
๐ช Sliding window
๐ Back-references
๐ Ratio stats
View โ
Lazy priority queue with amortized O(1) insert, find-min, decrease-key and union. Watch consolidation link equal-degree trees after extract-min, and cascading cuts propagate up marked ancestors on decrease-key.
โก Amortized O(1) insert
๐ Cascading cut
๐ Consolidation
View โ
Watch the edit-distance DP table fill cell by cell. Color-coded cells reveal each operation โ match (free), delete, insert, or replace โ and the optimal alignment path is traced back through the matrix.
๐ DP table
๐ฏ Path trace
โ๏ธ Live edit
View โ
Floyd's Tortoise and Hare algorithm in three phases: detect the cycle, locate the exact start node (ฮผ), and measure the cycle length (ฮป). Configure tail and cycle size, then watch the pointers converge.
๐ข Tortoise +1
๐ Hare +2
๐ ฮผ + ฮป
View โ
Watch the DP table fill cell by cell as LCS lengths are computed. Then trace back through the table to recover the actual subsequence โ the foundation of diff tools.
๐ DP table
โฉ Traceback
๐ค LCS highlight
View โ
Insert elements and query membership in a probabilistic bit-array filter. Watch k hash functions light up bit positions, observe the theoretical false-positive rate climb as the array fills, and trigger false positives live.
๐ข k hash fns
โ False positives
๐ FP rate formula
View โ
Find the longest palindromic substring in O(n). Watch the transformed string, p-array fill, center/boundary window, and free-copy vs. expand decisions step by step.
๐ p-array
๐ช C/R window
โก O(n)
View โ
Watch the DP table fill amount by amount as each coin denomination is tried. Improved cells light up on every new minimum, then traceback traces the exact coins used.
๐ DP table
โฉ Traceback
๐ช Coin highlight
View โ
Kahn's BFS-based topological ordering of a DAG. Watch in-degrees update, the queue grow and shrink, and edges get consumed one by one. A cycle graph demonstrates cycle detection with a partial result and red highlights.
๐ฅ In-degree table
๐ BFS queue
โ Cycle detection
View โ
Strings split into short leaf chunks, with internal nodes storing left-subtree weights. Animate index lookup, split the logical string at any position, then concatenate the two halves back together.
โ Split / concat
โ Weight-guided index
๐ฟ Chunked leaves
View โ
Watch the BWT build all rotations, sort them lexicographically, and extract the last column. Then reconstruct the original via LF-mapping inverse transform.
๐ Rotation matrix
๐ LF-mapping
โฑ Step mode
View โ
A hash ring with servers, virtual nodes, and keys. Add or remove servers and watch only nearby keys get remapped. Clockwise walk animation shows key-to-server assignment.
๐ต Virtual nodes
๐ Load balance
โฑ Animated
View โ
5-node Raft cluster with animated leader election, log replication, and heartbeat RPCs. Kill nodes to trigger re-election and watch the term system advance.
๐ต Leader election
๐ Log replication
๐ Node failure
View โ
Single-decree Paxos with 3 proposers, 5 acceptors, and 2 learners. Animated Prepare/Promise/Accept/Accepted message flow with conflict scenarios and node failures.
๐จ Message phases
โ Conflict preset
โฑ Step mode
View โ
Two hash tables with O(1) worst-case lookup. Insert keys and watch the eviction chain as displaced elements hop between tables. Cycle detection triggers rehash.
๐ต Two tables
๐ Eviction chain
๐ Auto rehash
View โ
Recursive โU decomposition achieving O(log log U) predecessor queries. Nested box visualization shows summary and cluster structure for universe U=16.
๐ข Universe display
๐ฆ Nested structure
๐ Successor query
View โ
Watch composites get crossed out as each prime sweeps through its multiples. Numbers that survive every sweep are prime โ classic O(n log log n) prime generation.
๐ฏ Prime sweep
๐ Prime count
โก O(n log log n)
View โ
Watch witness squaring chains reveal composite numbers. Decomposes nโ1 = 2หขยทd, then tracks a^d โ a^(2d) โ โฆ mod n โ any failure to hit nโ1 exposes a composite. Beats Carmichael numbers that fool Fermat's test.
๐ฏ Witness test
๐ Squaring chain
โก O(kยทlogยฒn)
View โ