alg
Algorithms
An interactive algorithms lab I built to turn textbook ideas into replayable, inspectable traces. Browse the catalog, jump into a focused scenario, and open a dedicated visualizer page when you want the full chart, canvas, and controls.
0
algorithms
0
categories
0
curated presets
mobile tips
The catalog is lighter on mobile now. Open a dedicated algorithm page when you want the full visualizer experience.
Inside the visualizer, rotate for wider charts and swipe left or right to move between steps.
algorithm catalog
Choose a lane, open a curated demo, then jump into a dedicated visualizer page when you want the chart or canvas.
42 algorithms
start here
These presets are the quickest way to see the strongest demos in this section.
start here
Bubble sort walkthrough
Best first stop for seeing pseudocode, counters, and step-by-step state changes line up.
opens a focused walkthrough
side by side
Linear vs binary
Compare scanning against range-halving on the same target and dataset.
opens compare mode
graph demo
Dijkstra pathfinding
Jump straight into the weighted graph view to inspect relaxations, costs, and the final route.
opens a focused walkthrough
filter
group
sorting
8 algorithmsBubble Sort
Repeatedly swaps adjacent out-of-order values so larger numbers drift to the end.
Selection Sort
Selects the minimum value from the unsorted suffix and places it into the next sorted slot.
Insertion Sort
Builds a sorted prefix by inserting each new value into the right gap.
Merge Sort
Recursively splits the array and merges sorted halves into a fully ordered result.
Quick Sort
Partitions the array around a pivot and recursively sorts the resulting partitions.
Heap Sort
Builds a max heap and repeatedly extracts the root to produce a sorted suffix.
searching
5 algorithmsLinear Search
Checks each value in sequence until a match is found or the array ends.
Binary Search
Halves the remaining search range around the middle element of a sorted array.
Select Minimum
Scans the array once while remembering only the smallest value seen so far.
Select Minimum and Maximum
Processes values in pairs so the smaller challenges the minimum and the larger challenges the maximum.
Quickselect
Partitions around a pivot and recurses only into the side that can still contain the requested order statistic.
graphs
10 algorithmsBreadth-First Search
Explores graph layers in queue order and finds shortest paths in unweighted graphs.
Depth-First Search
Follows one branch as deeply as possible before backtracking to try the next branch.
Dijkstra's Algorithm
Finds the shortest path from the source to every reachable node when all edge weights are non-negative.
Connected Components
Runs DFS from every unassigned vertex and labels each connected component with its own ID.
Cycle Detection (Undirected)
Uses DFS and parent tracking to detect whether an undirected graph contains a cycle.
Topological Sort (Kahn)
Builds a topological ordering by repeatedly removing zero-indegree vertices.
strings
7 algorithmsGusfield Z-Algorithm
Computes Z values in linear time by reusing the most recent rightmost Z-box.
Boyer-Moore String Matching
Boyer-Moore using extended bad-character, Zsuffix goodsuffix, matchedprefix, and the bound/Galil known-match optimization.
Knuth-Morris-Pratt Matching
KMP variant that computes SP values from the pattern Z-array, then shifts by i - SP_i after the first mismatch.
Burrows-Wheeler Transform
Constructs BWT with a prefix-doubling suffix array, then appends S[i - 1] for every suffix-array entry i.
BWT Reverse Transform
Recovers the original string from a BWT L column using rank/occ LF mapping.
BWT Backward Search
Runs backward search by shrinking [sp, ep] with rank and occ while reading the pattern right-to-left.
compression
3 algorithmsHuffman Coding
Builds a binary prefix-free code by repeatedly merging the two least frequent subtrees.
Elias Omega Coding
Encodes positive integers as self-delimiting bitstrings and packs shifted integer lists into bytes.
LZ77
Compresses text with a sliding search window, a lookahead buffer, and offset-length-character tuples.
number theory
3 algorithmsKaratsuba Integer Multiplication
Multiplies large integers with three half-size recursive products using a bit-split Karatsuba identity.
Modular Exponentiation by Squaring
Computes a^b mod n by scanning exponent bits from right to left while repeatedly squaring modulo n.
Miller-Rabin Primality Test
Tests primality by searching for modular-arithmetic witnesses of compositeness.
data structures
2 algorithmsFibonacci Heap
Maintains a lazy forest of heap-ordered trees with cheap insert, merge, and decrease-key operations.
B-Tree Operations
Searches, inserts, and deletes in a high-fanout balanced search tree with split, borrow, and merge repairs.
optimization
2 algorithmsSimplex Method
Solves a linear program by repeatedly pivoting a tableau while positive reduced costs remain.
Hungarian Assignment Algorithm
Solves the assignment problem by reducing a cost matrix and iterating over independent zero matchings.
approximation
2 algorithms2-Approximation for Vertex Cover
Builds a vertex cover by repeatedly choosing an uncovered edge and taking both endpoints.
2-Approximation for Metric TSP
Builds an MST, traverses it from a start vertex, and compresses repeated vertices into a Hamiltonian cycle.