Algorithms

Sorting and searching, divide and conquer, greedy algorithms, dynamic programming, and traversal over trees, heaps, and graphs.

Sorting and Searching

Search and sort are the two problems almost every other algorithm eventually leans on — a system that can't find or order its own data quickly enough usually can't do much else quickly either. Knuth's exhaustive…

Divide and Conquer

Merge sort's strategy — split the problem, solve the pieces, combine the results — generalises far beyond sorting into one of the most productive general-purpose algorithm design strategies in the field.

Greedy Algorithms

A greedy algorithm builds a solution one step at a time, always taking whichever choice looks best right now , and never reconsidering that choice later. That sounds like a reckless way to solve anything — and for many…

Dynamic Programming

Divide and conquer works cleanly when a problem's subproblems don't overlap. Many important problems don't have that property — the same smaller subproblem recurs again and again across different branches of the…

Trees, Heaps, and Graphs: Traversal and Construction

Data Structures as Behavioural Contracts covers what these structures promise and what that promise costs in Big-O terms. This page assumes that vocabulary and covers something it doesn't: the algorithms that actually…