The Complete Algorithms Course
A standalone, comprehensive journey through algorithms — from binary search and sorting to dynamic programming, graph algorithms, network flow, and NP-completeness. Every technique is brought to life with interactive, animated visualizations, and every code example is available in Python, Java, C++, and pseudocode.
Phase 1 · Foundations
How to reason about algorithms: correctness, Big-O, recursion, and recurrences.
Introduction to Algorithms
What an algorithm really is, what makes one correct and efficient, and a map of the design paradigms you'll master in this course.
Algorithm Analysis & Big-O
Measure how an algorithm's running time and memory grow with input size, independent of the machine it runs on.
Recursion, Recurrences & the Master Theorem
The technique behind divide & conquer and dynamic programming — and how to solve the recurrences it produces.
Correctness: Loop Invariants & Induction
Prove an algorithm actually works — every time — with loop invariants, induction, and termination arguments.
The Data Structures You'll Rely On
A fast, practical tour of the structures algorithms are built on — arrays, stacks, queues, heaps, hash maps, trees, and graphs — and their costs.
Phase 2 · Searching & Sorting
Binary search and the classic sorts, seen as algorithm design.
Searching & Binary Search
Find an element fast, then generalize binary search into one of the most powerful problem-solving tools you'll own.
Elementary Sorts
Bubble, selection, and insertion sort — simple, O(n²), and the perfect lens for learning to compare algorithms.
Merge Sort & Quick Sort
The two workhorse O(n log n) sorts — divide & conquer done two ways, one stable and one blazingly fast in place.
Heap Sort & Linear-Time Sorts
Sort with a heap, then break the O(n log n) barrier with counting, radix, and bucket sort — when the data allows.
Selection & Order Statistics
Find the k-th smallest element — even the median — in expected linear time, without fully sorting.
Phase 3 · Divide & Conquer
The split-solve-combine paradigm and its famous algorithms.
The Divide & Conquer Paradigm
The split-solve-combine template that powers merge sort and much more — and how to analyze it with recurrences.
Divide & Conquer in Action
Fast exponentiation, Karatsuba multiplication, and the closest-pair-of-points algorithm — classic wins from splitting a problem.
Phase 4 · Greedy Algorithms
Make the locally best choice — and prove when that is enough.
The Greedy Paradigm
Build a solution one locally optimal choice at a time — and learn the two properties that tell you when greedy is correct.
Classic Greedy Algorithms
Huffman coding, fractional knapsack, and scheduling — plus how MST and Dijkstra are greedy algorithms at heart.
Phase 5 · Dynamic Programming
Solve overlapping subproblems once — the heart of the course.
Introduction to Dynamic Programming
The single most powerful technique in the course: solve each overlapping subproblem once and reuse the answer.
1-D Dynamic Programming
Master the one-dimensional DP patterns — Fibonacci, climbing stairs, house robber, coin change, and rod cutting.
Knapsack & Subset-Sum DP
The 0/1 knapsack and its whole family — subset sum, partition, and bounded/unbounded variants — on a 2-D table.
Dynamic Programming on Sequences
Compare and transform sequences with DP: longest common subsequence, edit distance, and longest increasing subsequence.
DP on Grids & Intervals
Two more DP shapes: path-counting and cost on grids, and interval DP like matrix-chain and palindrome partitioning.
Advanced DP: Trees & Bitmask
Push DP onto trees and over subsets — tree DP, and bitmask DP for problems like the travelling salesman.
Phase 6 · Backtracking & Search
Explore, prune, and search state spaces and game trees.
Backtracking
Build candidates incrementally and abandon them the moment they can't work — the engine behind N-Queens and Sudoku.
Branch & Bound and Pruning
Turn backtracking into optimization: bound the best possible outcome of a branch and cut everything that can't beat it.
Adversarial Search: Minimax & Alpha-Beta
Search a game tree where an opponent plays against you — minimax, then alpha-beta pruning to search far deeper.
Phase 7 · Graph Algorithms
Traversal, connectivity, shortest paths, MST, flow, and matching.
Graph Representations & Traversal
Model anything as a graph, then visit every vertex systematically with breadth-first and depth-first search.
Connectivity: Topological Sort, SCC & Bridges
Order dependencies, find strongly connected components, and locate the bridges and articulation points that hold a graph together.
Shortest Paths
Find cheapest routes through weighted graphs — Dijkstra, Bellman-Ford, Floyd-Warshall, and the A* heuristic search.
Minimum Spanning Trees
Connect every vertex at the lowest total cost with Kruskal and Prim — and the union-find structure that makes Kruskal fly.
Network Flow: Max-Flow / Min-Cut
Push as much flow as a network allows — augmenting paths, the residual graph, and the max-flow min-cut theorem.
Bipartite Matching & Assignment
Pair up two groups optimally — maximum bipartite matching via augmenting paths and flow, plus the assignment problem.
Phase 8 · Strings, Math & Intractability
String matching, number theory, randomization, geometry, and NP-completeness.
String Matching
Find a pattern inside a text fast — the naive scan, Rabin-Karp hashing, and the linear-time KMP and Z algorithms.
Advanced String Algorithms
Go beyond single-pattern search: tries, suffix arrays, and Aho-Corasick for matching many patterns at once.
Number-Theoretic Algorithms
The math algorithms behind cryptography and competitive programming — GCD, modular arithmetic, sieves, and primality.
Randomized Algorithms
Let randomness do the work — randomized quicksort, reservoir sampling, and the Monte Carlo / Las Vegas distinction.
Computational Geometry
Algorithms on points and lines — orientation tests, the convex hull, and the sweep-line technique.
Intractability: P, NP & NP-Completeness
The theory of what's efficiently solvable — P vs NP, NP-completeness, reductions, and why some problems resist fast algorithms.
Coping with Hard Problems & Choosing an Algorithm
When a problem is intractable, you approximate. Plus a decision framework and master cheat sheet to pick the right algorithm.