Computer Science

Algorithms

Jeff Erickson

Algorithms cover

A free proof-oriented algorithms text on recursion, dynamic programming, graphs and reductions, after discrete mathematics and data structures.

Prerequisites

Discrete mathematics, mathematical induction, recursion and basic data structures are prerequisites. Review graphs, asymptotic notation and recurrence relations; this book does not teach queues, hash tables or balanced trees from scratch.

Edition
1
Publication Year
2019
Difficulty Level
Intermediate
Academic Level
Undergraduate
algorithm designgraph algorithmsNP hardness

01 / Reading Guide

Reading Guide

Algorithmic reasoning: choose a text and justify an optimization

Compare three algorithms books through proof, reference and modeling needs, then solve original weighted-scheduling problems with checked recurrences.

Study route and exercise: University Reading List editorial project.

Who this book is for

For undergraduates in an algorithms course after introductory programming and data structures. The author explicitly distinguishes the book from a first exposure to algorithms. Its main benefit is sustained practice in designing an algorithm, stating why it works and separating the reasoning about correctness from the running-time analysis.

Prerequisites

Discrete mathematics, mathematical induction, recursion and basic data structures are prerequisites. Review graphs, asymptotic notation and recurrence relations; this book does not teach queues, hash tables or balanced trees from scratch.

What it covers

Recursion and backtracking lead into dynamic programming, greedy methods, graph traversal, spanning trees, shortest paths, flows, cuts and NP-hardness. The book places design patterns beside worked reasoning. Additional lecture notes on the author’s page are separate supplements, so their topics should not be assumed to belong to the main volume.

How to use it

Before writing code, specify the input, the desired output and a small instance that exposes a tempting wrong approach. State the recursive subproblem or greedy choice precisely. Write a correctness argument and then analyze the resources used; neither step substitutes for the other. Use exercises to compare two approaches to the same problem, and construct counterexamples when a proposed improvement fails. Implement only after the design is clear, using small exhaustive cases to check the reasoning.

Edition and sources

The author’s complete first edition is dated June 2019 and contains 472 pages. The textbook uses CC BY 4.0, while the separate lecture notes on the same page use CC BY-NC-SA 4.0. Preserve that distinction when reusing material.

Open the official resource

Edition and learning check

The author identifies this as the June 2019 first edition and explicitly lists prerequisite data structures that it does not teach. Keep the main book’s CC BY 4.0 licence separate from the additional notes’ CC BY-NC-SA terms. Before using it as a spine, write an induction argument and a recurrence for a small recursive algorithm; if those are unfamiliar, review discrete mathematics first. For optimization exercises, give a feasibility argument and an objective value before claiming an optimum. Free book files do not imply an available official solution manual.

Source checked (2026-11-04).