algorithms

Implementing FFT

A derivation-oriented guide to FFT implementations, moving from recursive Cooley-Tukey to iterative and in-place variants without explicit bit reversal.

Convenient and near-optimal binary search on floating point numbers

A near-optimal floating-point binary search template that searches representable values via bit-casts instead of hard-coded iteration counts.

The Floyd-Warshall algorithm and its generalizations

A tour of Floyd-Warshall as an instance of aggregating over graph paths, leading to transitive closure, Kleene algebras, and the algebraic path problem.

A comprehensive guide to permutations for beginners

A guide to permutations through orderings, cycles, and composition, with pointers to common competitive-programming applications.

Greedoids: a formal way to look at families of greedily-solvable problems

A tutorial on greedoids as a framework for understanding when greedy-style reasoning works, with examples from matroids, antimatroids, and related structures.

Catalan Numbers and Generating Uniform Balanced Bracket Sequences

A tutorial on Catalan numbers and uniform random balanced bracket generation, building bijections and generators from first principles.

Binary search and other "halving" methods

A beginner-friendly guide to binary search as partition-point search, including invariants, variants, language APIs, and optimizations.

Traversing the complement graph in linear/near-linear time in multiple ways

A bunch of DFS and BFS ways to traverse a complement graph efficiently, including linear-time BFS and a DSU-style trick for the DFS case.