Skip to content

Programming and Algorithms

This book connects a precise model of a program to the choice and implementation of an algorithm. Language primers and type systems establish what code means; the algorithm chapters develop invariants, complexity, and data-structure choices; the practice chapters ask you to predict behavior and defend implementations across languages. The order-book case study shows those choices working together. Generating an implementation is easy to delegate; understanding its semantics and choosing evidence for its correctness remain your work.

76 sections

Start readingGlossary
  • Explain values, ownership, types, concurrency, and language behavior with concrete examples.
  • Choose data structures and algorithms from their invariants and complexity.
  • Predict an output before executing a program and diagnose the rule behind a surprise.
  • Validate an implementation with boundary cases, counterexamples, and resource measurements.
  • Defend an end-to-end build using its correctness and performance evidence.

Read the parts in order for the full progression, or choose a route below and follow its prerequisites. Pause at the review questions before revealing worked answers.

Start with one language and a terminal. Mathematics supplies discrete mathematics, probability, and the foundations for complexity arguments. Software Engineering develops testing and maintenance as engineering practices. Executable prediction and implementation projects remain under practice/; their explanations belong to this book.

How to read these books explains the shared first-principles, prediction, reasoning, testing, and validation method.