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.
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.
showing 11 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
6 algorithmsBubble Sort
Repeatedly swaps adjacent out-of-order values so larger numbers drift to the end.
best for
Use it mainly for learning and for discussing loop invariants, not for production sorting.
tradeoff
Too slow for large datasets.
Selection Sort
Selects the minimum value from the unsorted suffix and places it into the next sorted slot.
best for
Useful when swaps are expensive but comparisons are cheap, or when teaching simple in-place sorting.
tradeoff
Not stable in its usual form.
Insertion Sort
Builds a sorted prefix by inserting each new value into the right gap.
best for
Use for small datasets, nearly sorted data, or as a base case inside more advanced sorts.
tradeoff
Shifts can make it slow on long random arrays.
Merge Sort
Recursively splits the array and merges sorted halves into a fully ordered result.
best for
Use when stable ordering matters and extra memory is acceptable for consistent performance.
tradeoff
Needs extra memory for merging.
Quick Sort
Partitions the array around a pivot and recursively sorts the resulting partitions.
best for
Use when average-case speed and in-place behavior matter more than stability.
tradeoff
Worst-case time degrades to O(n²).
Heap Sort
Builds a max heap and repeatedly extracts the root to produce a sorted suffix.
best for
Use when you want in-place O(n log n) performance with strong worst-case guarantees.
tradeoff
Not stable.
searching
2 algorithmsLinear Search
Checks each value in sequence until a match is found or the array ends.
best for
Use for tiny datasets, streaming data, or one-off checks on unsorted collections.
tradeoff
Slow on large datasets.
Binary Search
Halves the remaining search range around the middle element of a sorted array.
best for
Use when the data is sorted and you need fast repeated lookups.
tradeoff
Requires random access and sorted input.
graphs
3 algorithmsBreadth-First Search
Explores graph layers in queue order and finds shortest paths in unweighted graphs.
best for
Use for reachability, level-order traversal, and shortest paths when every edge has equal cost.
tradeoff
Queue can grow large on wide graphs.
Depth-First Search
Follows one branch as deeply as possible before backtracking to try the next branch.
best for
Use when you want deep traversal behavior, backtracking, or graph structure analysis.
tradeoff
Does not guarantee the shortest path.
Dijkstra's Algorithm
Finds the shortest path from the source to every reachable node when all edge weights are non-negative.
best for
Use for shortest-path problems on weighted graphs with non-negative edge costs.
tradeoff
Not valid when negative-weight edges exist.
visual modes
Sorting algorithms use bar charts. Search algorithms use index cards. Graph algorithms switch to a node-link canvas on their dedicated pages.