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 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, the state under constraints, and amortised cost — and then closes with a chapter that takes their names away and asks you to choose. Eight chapters. Twenty-seven full derivations. Two hundred and eighty-five problems, each tagged [1] to [5] by how well its ambiguity is hidden rather than by how hard its eventual algorithm is. Every problem sits 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 algorithm in the book has been implemented and checked against a brute-force reference, and every stated measurement has been measured rather than estimated. The ten algorithms of the full derivations appear in Python and C++ in an appendix, cross-checked on two thousand generated inputs each. The book assumes first-year programming — variables, loops, conditionals, functions, arrays — and nothing else.
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.