Algorithms book cover

Your technical library

Algorithms

15 modules · 67 topics

About this book
Concepts · Algorithms

Algorithms

This course teaches how to turn a real problem into a procedure you can trust: say precisely what a correct answer is, derive the algorithm one decision at a time, prove why it works, count what it costs in a named model, and decide what to change when the requirements change. It is written for any engineer who calls sort, search and graph libraries and wants to know what they do and when they fail. It builds on Data Structures: that course owns the representations — arrays, hash tables, heaps, trees — and this one owns the procedures that use them.

The core path runs through seven modules. Problem modeling and reasoning turns a product request into a computational problem, defines what a correct answer is and counts the work a recursive procedure does. Scanning and searching covers pointer scans, sliding windows and binary search over any yes-or-no question that flips once. Sorting and selection, graph exploration and structure and shortest paths follow, then two ways of building a best answer: greedy algorithms, justified by exchange arguments, and dynamic programming, derived from the states a problem really has.

The advanced track widens the toolkit: exact search under constraints (backtracking, branch and bound, SAT solvers), flow and matching, text-processing algorithms, randomized and streaming algorithms, hardness, approximation, and online decisions — what to do when no fast exact algorithm exists — geometry and numerical computation, and parallel and data-movement-aware algorithms, where moving data costs more than computing on it. Worked decision studies closes both tracks by choosing among procedures as requirements change. Along the way each topic says what it inherits, what it leaves open, and the workload where a simpler procedure wins.

67 topics across 15 modules, in dependency order.

Code conventions: where a lesson has code, it states the algorithm in pseudocode first, then in Python using the names from the worked trace. Pseudocode comments use #, costs are counted in a named unit such as comparisons or relaxations, and every bound states whether it is worst-case, expected, or amortised.

67 of 67 topics are authored; the rest are labelled planned and excluded from progress. Each topic opens with the problem earlier topics left open and closes with what it still leaves open. Glossary and decision-guide entries cover the authored material and grow with the course.

Course map

Read at your own pace. Each topic is one continuous page; mark it done as you finish.

Start with 01.1 · Problem contracts: turn a request into a problemReview what you have finished