Examples
Every algorithm, .
23 classic programs - sorting, searching, graphs, recursion, dynamic programming - each one animated step by step so you can see exactly how it works.
Bubble sort
Repeatedly swaps adjacent out-of-order pairs until sorted.
Selection sort
Finds the smallest remaining element and swaps it into place.
Insertion sort
Builds a sorted prefix by shifting larger elements right.
Binary search
Halves the search range each step to find a target.
Fibonacci (recursion)
Classic exponential recursion - fib(n) = fib(n-1) + fib(n-2).
Coin change (DP)
Bottom-up DP for the fewest coins to make an amount.
LCS (2-D DP)
Longest common subsequence via a 2-D table.
Two-sum (hashmap)
Finds two indices summing to a target using a lookup object.
BFS (graph + queue)
Breadth-first traversal of an adjacency list using a queue.
DFS (graph + stack)
Depth-first traversal of an adjacency list using a stack.
Memoized fib (closure)
A cache captured in a closure turns fib exponential → linear.
Fibonacci generator
A generator function yields the fib sequence lazily.
Heapsort (binary heap)
In-place heapsort - build a max-heap, then extract the max.
Async / await
Awaited promises resolve step by step (time-warped: no real delay).
Binary search tree (class)
An OOP BST - insert builds the tree, inorder walks it sorted.
Stack (class)
A LIFO stack built as a class with push / pop / peek.
Inheritance (polymorphism)
Class hierarchy with super() and an overridden method.
Dijkstra (weighted graph)
Shortest paths over a weighted adjacency list.
FizzBuzz
The classic interview warm-up: divisibility branching in a loop.
Valid parentheses
A stack decides whether every bracket closes in the right order.
First unique character
Two passes with a Map: count everything, then find count === 1.
GCD (Euclid)
Recursion where the arguments shrink until the remainder is zero.
Matrix transpose
Rows become columns: a nested loop reindexing a 2D array.