Most algorithm books are catalogues. They present a technique, prove it correct, and give you problems on which to apply it — and they leave out the only part that is hard, which is knowing which technique the problem in front of you wants.
This book is the missing part. Every technique in it arrives at the end of a derivation you can follow: a real problem, an honest attempt that fails, the reason it failed, and the observation that opens it. The name of the technique is withheld until you have already built it, because a name learned before the thing it names is a label rather than an understanding. Nothing here is a catalogue entry. There is no chapter you can skim for a recipe.
Part I, Reading, Diagnosing, Building, builds seven instruments in the order they cost to use — reading a specification, brute force as a starting point, the first engine, invariants, structure that is already there, naming the state, and the limits of improvement — and then removes their labels and asks you to choose.
Part II, Complexity, is hidden structure at scale: trading space for time, reduction, greedy choice and when it deceives, divide and conquer, stored answers, searching huge spaces, graphs, randomness, and the decision to stop looking for an efficient solution.
Part III, Length, is for problems that are hard because there is a lot of them rather than because any piece is hard: where the boundary is, where to cut, how to layer, what an interface promises, how to check part of a whole, how to assemble correct parts into a correct whole, and what to do when the problem changes while you are solving it.
Twenty-five chapters in three parts, with an interlude between the first two. Ninety full derivations. Nine hundred and seventy problems, each tagged [1] to [5] by how well its difficulty is hidden rather than by how hard its eventual algorithm is, and each sitting in one of three layers: a full derivation you watch from the outside, a pivot with the rest left to you, or a statement and a single hint. Every problem left for you to finish — every Layer 2 and Layer 3 problem, and every problem of the Interlude — has a short answer at the back: the idea that decides it, the result, and a way to check your own, 887 answers in all, linked both ways. The book assumes first-year programming — variables, loops, conditionals, functions, arrays — and nothing else. The ten algorithms of Part I's full derivations are given in Python and C++ in an appendix.
This book was created through a process that combines careful human planning, content direction, and advanced AI technology, followed by thorough refinement and review to ensure a high-quality final work.