HackerTube.live
Books / Computer Science

THE READING ROOM / BOOK GUIDE

Algorithms + data structures=programs

Niklaus Wirth

Niklaus Wirth's textbook treats algorithms and data structures as two halves of one design problem, showing how the choice of representation shapes the procedure built on top of it.

About the book

Algorithms + Data Structures = Programs is a programming textbook by Niklaus Wirth, the computer scientist behind Pascal. Its title states the organizing claim: a program is what results when an algorithm meets a chosen data representation, and the two cannot be designed apart.

The book works through core topics in programming: data structures such as arrays, records, and linked lists; algorithms for sorting and searching; and the recursive and iterative techniques that connect them. Wirth writes in a systematic, example-driven register, using a notation close to Pascal to make procedures concrete. The emphasis falls on reasoning about correctness and efficiency rather than on any particular machine.

Because the material is presented as a discipline of construction, the book reads as an argument about how programmers should think. Each structure is introduced with the operations it supports and the costs it imposes, and algorithms are judged against those costs. That pairing is the through line, and it gives the text a coherence that many survey-style programming books lack.

How to read it

Approach the book as a course of study rather than a reference to skim. Work the examples on paper, trace the procedures by hand, and pay attention to the stated invariants and termination conditions. Wirth's prose is compact; a sentence often carries a design decision that rewards a second reading.

The notation reflects its era. Readers used to modern languages will need to translate Pascal-like constructs mentally, and some conventions feel dated. The underlying reasoning about lists, trees, sorting, and searching remains legible, but expect to supply your own implementation and testing as you go.

Who it suits

This suits readers who want a foundational account of how data representation and algorithm design interlock, especially students and self-taught programmers filling gaps left by language-focused tutorials. It also serves working developers who want the classical vocabulary of sorting, searching, and structured data explained from first principles. Readers who prefer modern code samples and immediate practical recipes will find the pace and notation slower going.

Reading considerations

The framing predates much of contemporary software practice, so treat specific techniques as historical foundations rather than current guidance. Edition and translation details vary, and later printings may differ in notation or examples; check which version you have before relying on page references. Test the book's cost arguments against a modern machine, since constant factors and memory assumptions have shifted considerably.

Follow the HN conversation

35 different recommenders are recorded in the upstream dataset. These are AI-classified source counts, not an independent rating.

Search HN comments about this book ↗

Explore videos on the same subject ↗

Book notes prepared with DeepSeek, using catalogue records and Open Library subject information. They are reading guidance, not a personal review or a verified chapter-by-chapter account. Book details can vary by edition. HN data methodology · Book metadata and covers.