planned · bars & tiles
Insertion Sort
Grow a sorted prefix by shifting each new key into place.
a codestep.org project
a visual reference for algorithms
algorithm
Step through 5 algorithms line by line: the reference code, the math behind each step, and a timeline you control. Every trace is generated from the implementation you are reading and conformance-checked at build time.
5/8 live
The mechanics that move values: scans, swaps, shifts, partitions and merges.
no single author
Scan one element at a time until the key appears.
best O(1) · average O(n) · worst O(n) · space O(1)
1946 · John Mauchly
Halve a sorted interval on every comparison.
best O(1) · average O(log n) · worst O(log n) · space O(1)
1959 · Tony Hoare
Partition around a pivot, then recurse.
best O(n log n) · average O(n log n) · worst O(n²) · space O(log n)
1945 · John von Neumann
Halve the array, sort each run, merge them back.
best O(n log n) · average O(n log n) · worst O(n log n) · space O(n)
1964 · J. W. J. Williams
Build a max-heap, then extract the maximum until one element remains.
best O(n log n) · average O(n log n) · worst O(n log n) · space O(1)
planned · bars & tiles
Grow a sorted prefix by shifting each new key into place.
planned · stacked rows
Count occurrences, then lay the values down in order.
planned · stacked rows
Sort digit by digit, stable on every pass.
0/6 live
Where values live: slots, trees, heaps and disjoint sets.
planned · hash table
Turn a key into a slot index with a hash function.
planned · hash table
Resolve collisions and find the slot that holds the key.
planned · tree
Insert, search and delete while keeping the search-tree invariant.
planned · tree
Sift up and sift down to keep the heap property.
planned · tree
Track components with parent links and path compression.
planned · tree
Walk a prefix tree to store and find words.
0/10 live
Traversal, shortest paths, spanning trees and flow on nodes and edges.
planned · graph
Explore a graph in rings, one frontier at a time.
planned · graph
Follow one path to its end, then backtrack.
planned · graph
Grow the shortest-path tree outward from the source.
planned · graph
Relax every edge n−1 times and catch negative cycles.
planned · table
Fill a distance matrix one intermediate vertex at a time.
planned · graph
Dijkstra guided by a heuristic that points at the goal.
planned · graph
Order a DAG so every edge points forward.
planned · graph
Add the cheapest edge that does not close a cycle.
planned · graph
Grow a minimum spanning tree from a single vertex.
planned · graph
Push flow along augmenting paths until none remain.
0/10 live
The patterns behind the algorithms: recursion, tables, pruning and windows.
planned · tree
Solve a problem with smaller copies of itself.
planned · tree
Split, solve each part, then combine the answers.
planned · stacked rows
Take the best local choice and prove it is safe.
planned · table
Cache overlapping subproblems in a table.
planned · table
Build candidates and undo the ones that fail.
planned · tree
Prune any branch that cannot beat the current bound.
planned · text
Slide a range and update its statistics in O(1).
planned · bars & tiles
Walk two indices toward each other or together.
planned · bars & tiles
Binary search a monotone predicate over the answer space.
planned · bars & tiles
Precompute cumulative sums for O(1) range queries.
0/6 live
Matching, comparing and editing text without rescanning what you already know.
planned · text
Match a pattern with a failure table that skips rechecks.
planned · text
Compare rolling hashes, then verify the match.
planned · text
Skip ahead using the bad-character rule.
planned · table
Decide a match with recursive states or a DP table.
planned · table
Turn one string into another at minimum cost.
planned · table
Find the longest subsequence two strings share.
0/5 live
Number theory, primes and the transforms behind fast computation.
planned · numbers
Repeated remainders collapse to the greatest common divisor.
planned · table
Cross out multiples to leave the primes standing.
planned · numbers
Square the base and halve the exponent.
planned · plot
Turn a signal into frequencies by divide and conquer.
planned · table
Combine rows and columns, and divide blocks to go faster.
0/5 live
Learning and search: gradients, trees, clusters and populations.
planned · plot
Follow the negative gradient downhill.
planned · graph
Send the error backwards to update every weight.
planned · scatter
Assign points to the nearest centroid, then move the centroids.
planned · tree
Split on the question that lowers impurity the most.
planned · scatter
Evolve a population with selection, crossover and mutation.
pace under your control
Granular stepping, a scrubbable timeline, and a projector mode. Pace control is the highest-value interaction feature in the algorithm-visualization research.
math on every step
The invariant, the comparison count, the halving argument — cross-highlighted against the exact operation running in the code.
verified traces
Traces are produced at build time by the instrumented Python source shown in the editor, then conformance-checked in CI.