Following Cormen, Leiserson, Rivest, and Stein

Design and Analysis of Algorithms

Lecture notes, visualizations, and implementations in Python, C++, Java, Go, Ruby, JavaScript, and Clojure, following the textbook chapter by chapter.

Browse the chapters View on GitHub

A weighted graph with a highlighted shortest path
Finite subdivision of a radial link
"The best programs are written so that computing machines can perform them quickly and so that human beings can understand them clearly. A programmer is ideally an essayist who works with traditional aesthetic and literary forms as well as mathematical concepts, to communicate the way that an algorithm works and to convince a reader that the results will be correct." Donald Knuth

Chapters

Part I Foundations

  1. 1 The Role Of Algorithms
  2. 2 Getting Started
  3. 3 Growth Of Functions
  4. 4 Divide And Conquer
  5. 5 Randomized Algorithms

Part II Sorting And Order Statistics

  1. 6 Heapsort
  2. 7 Quicksort
  3. 8 Sorting In Linear Time
  4. 9 Medians And Order Statistics

Part III Data Structures

  1. 10 Elementary Data Structures
  2. 11 Hash Tables
  3. 12 Binary Search Trees
  4. 13 Red Black Trees
  5. 14 Augmenting Data Structures

Part IV Advanced Design And Analysis Techniques

  1. 15 Dynamic Programming
  2. 16 Greedy Algorithms
  3. 17 Amortized Analysis

Part V Advanced Data Structures

  1. 18 B Trees
  2. 19 Fibonacci Heaps
  3. 20 van Emde Boas Trees
  4. 21 Data Structures For Disjoint Sets

Part VI Graph Algorithms

  1. 22 Graph Algorithms
  2. 23 Minimum Spanning Trees
  3. 24 Single Source Shortest Paths
  4. 25 All Pairs Shortest Paths
  5. 26 Maximum Flow

Part VII Selected Topics

  1. 27 Multithreaded Algorithms
  2. 28 Matrix Operations
  3. 29 Linear Programming
  4. 30 Polynomials And The FFT
  5. 31 Number Theoretic Algorithms
  6. 32 String Matching
  7. 33 Computational Geometry
  8. 34 NP Completeness
  9. 35 Approximation Algorithms

Other Material