a logo with some yellow and blue circles and lines

A First Course in Algorithms

by Bo Waggoner

This book covers a one-semester undergraduate course in Algorithms. It grew out of a set of lecture notes and is best-suited as technical reference material rather than as a fully stand-alone algorithms text.

Get the book

Topics Covered

The book covers the following seven "Topics", each of roughly equal size. (Hash tables are placed in a topic with P vs. NP for this logistical reason.)

  1. Big-O Notation and Complexity
  2. Divide and Conquer
  3. Graph Traversal
  4. Greedy Algorithms
  5. Max Flow
  6. Dynamic Programming
  7. Hash Tables; and P vs. NP

Prerequisites

Programming: Experience reading and writing short programs; familiarity with variables, loops, conditionals (if statements), and so on. Ability to step through the execution of a short program using pen and paper. Experience with recursion. Familiarity with python syntax is beneficial.

Data Structures: Arrays, lists, queues. Familiarity with binary search trees is beneficial.

Discrete Math: Proofs; proofs of "there exists" and "for all" statements. Proof by induction. Counting, summations, sums of series such as $1 + 2 + \cdots + n$. Modular arithmetic. Familiarity with graphs and trees is beneficial. Basic probability is slightly beneficial.

Calculus: Derivatives. Limits. Properties of exponentials and logarithms, such as $2^{x+y} = 2^x 2^y$ and $\log(x^k) = k \log(x)$.

Contact and Errata

Please send feedback, suggestions, and error reports by email to Bo Waggoner with a subject line like "First Course in Algorithms".

License and Citation

Created with Quarto.

License: [CC-BY]. You may distribute, remix, adapt, and build upon this material in any medium or format so long as attribution is given.

Citation:

@book{waggoner2025first,
  title = {A First Course in Algorithms},
  author = {Waggoner, Bo},
  year = {2025},
  publisher = {Self published},
  url = {https://bwag.prof/firstalg/}
}