Every algorithm, data structure, theorem or construction known by a name (about 400, grouped by first letter; use the table of contents to jump), with what it does and where it lives in these notes. For âwhich algorithm solves which problem in what timeâ, see the đŹ Complexity Cheat Sheet; for famous problems, see đŹ Classic Problems.
A
| Name | What it does | Note |
|---|---|---|
| A* search | shortest path guided by an admissible heuristic | Informed Search |
| Ackermann function (inverse α) | the near-constant factor in DSU and MST bounds | Disjoint Set Union |
| Adaptive Simpson | numerical integration with Richardson correction | Root Finding and Integration |
| AMâGMâHM inequality | arithmetic mean geometric mean harmonic mean, equality iff all terms equal | đŹ Formula |
| AgrawalâKayalâSaxena (AKS) | first deterministic polynomial-time primality test | Theoretical Algorithms Catalog |
| AhoâCorasick automaton | multi-pattern matching with suffix links | Trie and AhoâCorasick |
| AhoâCorasick | many-pattern matching with an automaton of failure links | Trie and Aho-Corasick |
| AhoâHopcroftâUllman | linear-time rooted tree isomorphism (the AHU canonical labels) | Tree Isomorphism and PrĂŒfer Codes |
| AHU encoding | canonical form of rooted trees, tree isomorphism | Tree Isomorphism |
| AhujaâOrlin | scaling max-flow and min-cost flow algorithms | Theoretical Algorithms Catalog |
| AldousâBroder | uniform random spanning tree by a random walk | Matrix-Tree Theorem |
| Aliens trick (WQS binary search, Lagrangian relaxation) | remove a âexactly â constraint by penalising | Aliens Trick |
| Andrewâs monotone chain | convex hull in | Convex Hull |
| AndrĂ©âs reflection principle | lattice paths with one or two boundaries | Catalan and Lattice Paths |
| ApostolicoâGiancarlo | BoyerâMoore variant with at most comparisons | Theoretical Algorithms Catalog |
| AppelâHaken (four colour theorem) | every planar graph is 4-colourable | Special Graph Classes |
| Arpaâs trick | offline RMQ with a DSU in per query | Range Minimum Query |
B
| Name | What it does | Note |
|---|---|---|
| Baby-step giant-step | discrete logarithm in | Discrete Log |
| Bernoulliâs inequality | for , | đŹ Formula |
| Beattyâs theorem | and partition the positive integers | SpragueâGrundy |
| BEST theorem | counts Eulerian circuits as arborescences times | Euler Tours |
| Baeza-YatesâGonnet (Shift-And / Shift-Or) | bit-parallel string matching in | Other Pattern Matching |
| Ballot problem (Bertrand) | probability one candidate stays strictly ahead: | Catalan Numbers and Lattice Paths |
| BanachâKnaster (last diminisher) | proportional cake division for people | Cake Cutting |
| Barbierâs theorem | every curve of constant width has perimeter | Buffonâs Needle |
| Bareiss algorithm | fraction-free exact integer determinant | Determinants |
| Bareiss elimination | fraction-free integer determinant | Determinants and Permanents |
| BarnesâHut | approximate -body forces with a quadtree | KD-Tree and Spatial Structures |
| Barrett reduction | division-free modular reduction for run-time moduli | Barrett and Montgomery |
| BaumâWelch | EM training of hidden Markov models | DAG and Expected-Value DP |
| Bayesâ theorem | Probability and Expectation | |
| Bell triangle | Bell numbers in O(n^2) | Stirling, Bell and Partitions |
| Bell triangle, Bell numbers | number of set partitions | Counting Fundamentals |
| BellmanâFord | shortest paths with negative edges, negative-cycle detection | Shortest Paths |
| BellmanâHeldâKarp | bitmask DP for TSP in | Hamiltonian Paths and TSP |
| BenczĂșrâKarger | graph sparsification preserving all cuts | Global Minimum Cut |
| BenderâFarach-Colton | / LCA and RMQ via ±1 RMQ | Range Minimum Query |
| BentleyâShamos | divide-and-conquer closest pair in | Closest Pair |
| Bergeâs theorem | a matching is maximum iff it has no augmenting path | Bipartite Matching |
| BerkmanâVishkin | parallel and linear-time RMQ / LCA | Theoretical Algorithms Catalog |
| Berlekampâs algorithm | deterministic factorisation over small finite fields | Polynomial Factorization |
| Berlekampâs rule (Blue-Red stalks) | value of a Hackenbush stalk from its colour sequence | Hackenbush |
| BerlekampâMassey algorithm | shortest linear recurrence of a sequence | Linear Recurrences |
| BerlekampâMassey | shortest linear recurrence of a sequence | Linear Recurrences |
| BernsteinâNanongkaiâWulff-Nilsen | near-linear negative-weight shortest paths | Theoretical Algorithms Catalog |
| Binetâs formula | closed form | Generating Functions |
| Birthday paradox | collisions after random samples | Probability and Expectation |
| Bitap (shift-and) | bit-parallel exact and approximate matching | Other Matching |
| Bitset (word-RAM) tricks | -fold speedups of DP and set operations | Bitset |
| Björklundâs hafnian algorithm | weighted perfect matchings of a general graph in O(n^4 2^(n/2)) | Determinants |
| BjörklundâHusfeldtâKoivisto | chromatic number / set cover in by inclusionâexclusion | Graph Coloring |
| Blandâs rule | anti-cycling pivot rule for the simplex method | Linear Programming |
| Block-cut tree | tree of biconnected components and cut vertices | Bridges and Biconnectivity |
| Bloom filter | set membership with false positives only | Sampling and Streaming |
| Blossom (Edmonds) | maximum matching in general graphs | General Matching |
| Bluestein (chirp-z) | DFT of arbitrary length via convolution | Convolution Variants |
| Bluesteinâs algorithm | DFT of arbitrary length as a convolution | Convolution Variants |
| BoeschâTindell | which mixed graphs have a strongly connected orientation | Bridges and Biconnectivity |
| BondyâChvĂĄtal closure | Hamiltonicity via degree-sum closure | Hamiltonian Paths and TSP |
| Bonferroni inequalities | truncated inclusionâexclusion gives alternating bounds | InclusionâExclusion |
| Booth / minimal rotation | lexicographically least rotation in | Lyndon Words |
| Boothâs algorithm | least rotation of a string | Lyndon Words |
| BorĆŻvka | MST in , parallel-friendly | MST |
| Bose construction | Steiner triple system on points from an idempotent quasigroup | Kirkmanâs Schoolgirls |
| BoseâNelson | sorting networks for small | Sorting, Selection and Inversions |
| BostanâMori algorithm | [x^n] P/Q in O(k log k log n) | Linear Recurrences |
| BostanâMori | -th term of a linear recurrence in | Linear Recurrences |
| Boutonâs theorem | Nim position is losing iff the XOR of heaps is 0 | Combinatorial Games and Nim |
| BowyerâWatson | incremental Delaunay triangulation | Delaunay and Voronoi |
| BoyerâMoore algorithm | right-to-left matching with bad-character and good-suffix shifts | Other Matching |
| BoyerâMoore majority vote | majority element in space | Classic Array Problems |
| BoyerâMooreâGalil | BoyerâMoore with a linear worst case | Theoretical Algorithms Catalog |
| BoyerâMooreâHorspool | simplified BoyerâMoore with the bad-character rule only | Other Pattern Matching |
| BoyerâMyrvold | linear-time planarity testing and embedding | Special Graph Classes |
| Brentâs cycle detection | cycle detection with fewer evaluations than Floyd | Functional Graphs |
| BrentâKung composition | f(g(x)) by baby-step giant-step | Composition and Taylor Shift |
| BrentâKung | power-series composition in | Composition and Taylor Shift |
| Broken profile DP | grid tiling DP over a cell-by-cell frontier | Broken Profile DP |
| BronâKerbosch | maximal clique enumeration with pivoting | Maximum Clique and Independent Set |
| Buffonâs needle | crossing probability ; Monte Carlo estimate of | Buffonâs Needle |
| Burnside / PĂłlya | counting up to symmetry | Burnside and PĂłlya |
| BurrowsâWheeler transform | last column of sorted rotations; FM-index | BurrowsâWheeler |
| BurrowsâWheeler transform, FM-index | compression and pattern counting on a suffix-sorted string | Burrows-Wheeler |
| Buss kernel | vertex cover kernel with at most kÂČ edges | Complexity Theory |
C
| Name | What it does | Note |
|---|---|---|
| CarathĂ©odoryâs theorem | a point in the convex hull of is in the hull of at most points of | Convex Hull |
| CantorâZassenhaus algorithm | randomised factorisation over finite fields | Polynomial Factorization |
| CantorâZassenhaus | randomized factorization of polynomials over | Polynomial Factorization |
| Carmichael numbers, Carmichael λ | Fermat pseudoprimes to every base; the exponent of | Primality Testing and Factorization |
| Cassiniâs identity | Number Theory Miscellany | |
| Catalan numbers | brackets, trees, triangulations, Dyck paths | Catalan and Lattice Paths |
| CauchyâBinet | determinant of a product of rectangular matrices | Matrix-Tree Theorem |
| CauchyâSchwarz | Graph Basics and Modeling | |
| Cayleyâs formula | n^(n-2) labelled trees, rooted forests k n^(n-k-1) | Counting Graphs and Trees |
| Cayleyâs formula, PrĂŒfer code | labelled trees, tree sequence bijection | PrĂŒfer Codes |
| CayleyâHamilton theorem | a matrix satisfies its characteristic polynomial; A^k via x^k mod chi | Characteristic Polynomial |
| CayleyâHamilton | a matrix satisfies its characteristic polynomial | Characteristic Polynomial |
| CDQ divide and conquer | offline 3D dominance / dynamic problems | CDQ |
| Centroid decomposition | all-paths problems on trees in | Centroid Decomposition |
| Chanâs algorithm | output-sensitive convex hull in | Convex Hull |
| Chazelle | linear-time polygon triangulation; soft-heap MST in | Theoretical Algorithms Catalog |
| Chebyshev distance | ; rotate 45° to turn it into Manhattan | Attacking a Problem |
| ChenâFoxâLyndon theorem | unique factorization of a string into non-increasing Lyndon words | Lyndon Words and Minimal Rotation |
| ChernoffâHoeffding bounds | exponential tail bounds for sums of independent variables | Probability and Expectation |
| Chinese remainder theorem, Garner | combine congruences | CRT |
| Chirp-z transform | evaluation at a geometric progression / DFT of any length | Convolution Variants |
| Christofides | 3/2-approximation for metric TSP: MST + min matching on odd vertices + Euler tour | Approximation Algorithms |
| Chtholly tree (ODT) | assign-heavy interval maps on random data | Chtholly Tree |
| ChuâLiuâEdmonds | minimum arborescence (directed MST) | Directed MST |
| ChurchâTuring thesis | every effective procedure is a Turing machine | Complexity Theory and NP-Hardness |
| Cipolla, TonelliâShanks | modular square roots | Modular Square Roots |
| CockeâYoungerâKasami (CYK) | context-free parsing by interval DP | Interval DP |
| CoffmanâGraham | two-processor precedence scheduling / layered drawing | DAGs and Topological Sort |
| Colon and fusion principles | reduce green Hackenbush on any graph to a number | Hackenbush |
| Color coding (AlonâYusterâZwick) | k-vertex paths in O((2e)^k m) expected | Randomized Search |
| Commentz-Walter | multi-pattern BoyerâMoore over a reversed trie | Theoretical Algorithms Catalog |
| Convex hull trick, Li Chao tree | min / max of lines queries, DP speedups | Convex Hull Trick |
| Conwayâs surreal numbers | values of partizan games | Hackenbush and Partizan Games |
| CookâLevin theorem | SAT is NP-complete | Complexity Theory and NP-Hardness |
| CooleyâTukey FFT | convolution in | FFT |
| CooperâHarveyâKennedy | simple iterative dominator algorithm | Dominator Tree |
| CoppersmithâWinograd | matrix multiplication | Theoretical Algorithms Catalog |
| Cops and robber (dismantlable graphs) | one cop wins iff corners can be deleted down to one vertex | Games on Graphs |
| Count-Min sketch | approximate frequency counts in small memory | Fast Set and Integer Structures |
| CountâMin sketch | frequency estimates with additive error Δn | Sampling and Streaming |
| Courcelleâs theorem | MSO properties are linear-time on bounded treewidth | Complexity Theory and NP-Hardness |
| Coverâs switching strategy | randomized threshold that beats in the two-envelope game | Two Envelopes |
| Cramerâs rule | Determinants and Permanents | |
| CrochemoreâPerrin (Two-Way) | time, space string matching (glibc memmem) | Theoretical Algorithms Catalog |
| Cycle lemma | exactly k good rotations of a sequence with steps at most 1 and sum k | Catalan and Lattice Paths |
D
| Name | What it does | Note |
|---|---|---|
| DamerauâLevenshtein | edit distance with adjacent transpositions | LIS, LCS and Edit Distance |
| Dancing links (Algorithm X) | exact cover search | Exact Cover |
| de Bruijn graph / sequence | cyclic sequence containing every length- word once | Euler Tours |
| de FraysseixâRosenstiehl | left-right planarity test | Special Graph Classes |
| Delaunay / Voronoi | triangulation and nearest-site diagrams | Delaunay and Voronoi |
| Dialâs algorithm | Dijkstra with buckets for small integer weights | Shortest Paths |
| Dijkstra | single-source shortest paths, non-negative weights | Shortest Paths |
| Dilworth, Mirsky | chain covers vs antichains | Bipartite Matching |
| Dinic | max flow by blocking flows | Max Flow |
| Dinkelbachâs iteration | fractional programming by repeated parametric solves | Binary Search |
| DinurâSteurer | hardness of set cover | Approximation Algorithms |
| Divide and conquer DP optimization | monotone optimum, | D&C Optimization |
| DobkinâKirkpatrick | hierarchical convex polyhedron for queries | Point Location and Point Counting |
| Dominator tree (LengauerâTarjan) | immediate dominators in flow graphs | Dominator Tree |
| DowneyâFellows | parameterized complexity, W-hierarchy | Complexity Theory and NP-Hardness |
| DreyfusâWagner | Steiner tree DP in | Steiner Tree |
| DSU on tree (sack) | offline subtree queries in | Small to Large |
| Duâs sieve, Min_25 sieve | prefix sums of multiplicative functions in sublinear time | Sublinear Sieves |
| DubinsâSpanier moving knife | proportional cake cutting with cuts | Cake Cutting |
| DurandâKerner | simultaneous iteration for all polynomial roots | Root Finding and Integration |
| Duval | Lyndon factorization in | Lyndon Words |
| Duvalâs algorithm | Lyndon factorisation in O(n) | Lyndon Words |
E
| Name | What it does | Note |
|---|---|---|
| Edmondsâ arborescence (ChuâLiu) | minimum directed spanning tree | Directed MST |
| ErdĆsâGallai theorem | which degree sequences are graphical, via a partial-sum condition | Special Graph Classes |
| EdmondsâKarp | max flow by BFS augmenting paths | Max Flow |
| Eertree | palindromic tree: one node per distinct palindrome | Eertree |
| Eertree (palindromic tree) | all distinct palindromes online | Eertree |
| Eisensteinâs criterion | a sufficient condition for irreducibility over | Polynomial Factorization |
| Eppsteinâs algorithm | shortest walks in | K Shortest and Disjoint Paths |
| Eratosthenes | primes up to in | Sieves |
| ErdĆsâSzekeres theorem | distinct numbers contain an increasing run of or a decreasing one of | Pigeonhole Puzzles |
| EswaranâTarjan | minimum edges to make a digraph strongly connected: | SCC and 2-SAT |
| Euclidâs formula (Pythagorean triples) | all primitive triples as (mÂČ â kÂČ, 2mk, mÂČ + kÂČ) | Number Theory Miscellany |
| EuclidâEuler theorem | even perfect numbers are | Primality Testing and Factorization |
| Euler transform | counting multisets / sets from object counts via exp | Counting with Power Series |
| Eulerâs formula (planar graphs) | for a graph embedded in the plane | Planar Faces |
| Eulerâs theorem, Fermatâs little theorem | Modular Arithmetic | |
| Euler tour tree | link / cut with subtree aggregates | Euler Tour Tree |
| EvenâPaz | proportional cake cutting with queries by divide and conquer | Cake Cutting |
| Extended Euclid | Bézout coefficients, inverses | GCD and Extended Euclid |
F
| Name | What it does | Note |
|---|---|---|
| FaddeevâLeVerrier algorithm | characteristic polynomial and inverse from traces | Characteristic Polynomial |
| Faginâs theorem | NP = existential second-order logic | Complexity Theory |
| Farach-ColtonâBender | / RMQ | RMQ |
| Farey sequence next term | O(1) step to the next reduced fraction with denominator †n | Big Integers and Fractions |
| Farey sequence | reduced fractions with bounded denominator, mediant neighbours | Continued Fractions and Pell Equations |
| Fellerâs weak law (St. Petersburg) | St. Petersburg games pay about | St. Petersburg Paradox |
| Fenwick tree (BIT) | prefix sums with point updates | Fenwick Tree |
| FineâWilf periodicity lemma | periods p, q with give period | String Basics |
| First Fit Decreasing | bin packing within 11/9 OPT + 6/9 | Approximation Algorithms |
| FisherâYates shuffle | uniform random permutation in | Randomized Algorithms |
| FKM algorithm | de Bruijn sequences from Lyndon words | Lyndon Words |
| Floydâs cycle finding | tortoise and hare | Functional Graphs |
| Floydâs sampling algorithm | k distinct uniform values from [0, n) in O(k) | Sampling and Streaming |
| FloydâWarshall | all-pairs shortest paths | Shortest Paths |
| FM-index | backward search pattern counting on the BWT | BurrowsâWheeler |
| FordâFulkerson | augmenting paths, max-flow min-cut | Max Flow |
| FordâJohnson (merge insertion) | sorting with near-minimum comparisons | Sorting, Selection and Inversions |
| Fortuneâs algorithm | Voronoi diagram by a sweep line in | Delaunay and Voronoi |
| FrameâStewart | Tower of Hanoi with 4+ pegs | Tower of Hanoi |
| FredmanâTarjan | Fibonacci heaps; Dijkstra in | Heaps |
| FredmanâWillard | fusion trees: predecessor in | Fast Set and Integer Structures |
| FredricksenâKesslerâMaiorana | de Bruijn sequence by concatenating Lyndon words | Lyndon Words and Minimal Rotation |
| Freivaldsâ algorithm | check in per random trial | Randomized Algorithms |
| Frobenius number (Chicken McNugget) | largest non-representable amount | Linear Congruences and CRT |
| FussâCatalan numbers | k-ary trees, generalised ballot | Catalan and Lattice Paths |
| FĂŒrerâs algorithm | integer multiplication in | Theoretical Algorithms Catalog |
G
| Name | What it does | Note |
|---|---|---|
| Gabowâs algorithm | path-based SCC with two stacks | SCC and 2-SAT |
| GabowâEdmonds | efficient weighted general matching | Theoretical Algorithms Catalog |
| GabowâTarjan | cost-scaling assignment and matching | Assignment Problem |
| Galeâs Hex theorem | a full Hex board has exactly one winner (boundary-walk proof) | Chomp and Hex |
| GaleâRyser | which degree pairs are realisable by a bipartite graph | Special Graph Classes |
| GaleâShapley | stable marriage | Stable Matching |
| GalilâSeiferas | linear-time string matching with extra space | Theoretical Algorithms Catalog |
| GallaiâEdmonds decomposition | structure of maximum matchings in general graphs | General Matching |
| Garnerâs algorithm | mixed-radix CRT reconstruction (three-prime NTT) | NTT |
| GarsiaâWachs | optimal alphabetic binary tree in | Knuth-Yao Optimization |
| Gaussian elimination, Bareiss | linear systems, rank, determinant | Gaussian Elimination |
| GaussâJordan elimination | reduced row echelon form, inverse, rank | Gaussian Elimination, Rank and Inverse |
| GaussâLegendre quadrature | exact for polynomials of degree | Root Finding and Integration |
| GoemansâWilliamson | 0.878-approximation of max-cut via an SDP | Approximation Algorithms |
| GoldbergâTarjan | pushârelabel max flow; cost scaling | Maximum Flow |
| GolombâDickman constant | expected longest cycle of a random permutation | 100 Prisoners |
| Gomoryâs domino theorem | a chessboard minus one white and one black square is domino-tileable | Mutilated Chessboard |
| GomoryâHu tree | all-pairs min cuts with flows | Gomory-Hu Tree |
| Gonzalez farthest-point clustering | 2-approximation for k-center | Approximation Algorithms |
| GoodâThomas (prime-factor FFT) | DFT of length , coprime factors, no twiddles | Theoretical Algorithms Catalog |
| Graeffe iteration | root squaring for polynomials and for BostanâMori | Composition and Taylor Shift |
| Graham scan | convex hull | Convex Hull |
| Gray code | adjacent subsets differ in one bit | Gray Code |
| Greenâs theorem | area of a region from a boundary integral (circle union) | Circle Union and Angular Sweep |
| Greeneâs theorem | RSK shape = sizes of disjoint increasing subsequences | Young Tableaux and RSK |
| Groverâs algorithm | quantum search in | Complexity Theory and NP-Hardness |
| GuibasâStolfi | divide-and-conquer Delaunay with the quad-edge structure | Delaunay and Voronoi |
| GuyâSmith periodicity theorem | a row game whose Grundy values repeat on a finite window is periodic forever | SpragueâGrundy |
H
| Name | What it does | Note |
|---|---|---|
| Hadamard bound | Determinants and Permanents | |
| Half-GCD | polynomial gcd in O(n log^2 n) | GCD and Resultant |
| Hellyâs theorem | if every of a family of convex sets in intersect, the whole family intersects; underlies LP-type algorithms | Linear Programming |
| Hall, König, Tutte | matching existence and min-max theorems | Bipartite Matching |
| Hallâs theorem / condition | a perfect matching of exists iff for every | Bipartite Matching |
| Hamming distance | number of differing positions (popcount of XOR) | Bitset |
| Handshake lemma | ; the number of odd vertices is even | Graph Basics and Modeling |
| HanâThorup | integer sorting in | Theoretical Algorithms Catalog |
| HarelâTarjan | first / LCA | Theoretical Algorithms Catalog |
| Harmonic numbers | , the harmonic-lemma bound | Harmonic Lemma and Floor Sums |
| Hasseâs theorem | Theoretical Algorithms Catalog | |
| HavelâHakimi | test and construct a graph with a given degree sequence | Special Graph Classes |
| Heavy-light decomposition | path queries in | HLD |
| HeldâKarp | TSP / Hamiltonian path DP in | Hamiltonian Paths and TSP |
| Heronâs formula | triangle area from its side lengths | Polygons |
| Hessenberg method | characteristic polynomial in | Characteristic Polynomial |
| Hessenberg reduction | characteristic polynomial in O(n^3) | Characteristic Polynomial |
| Hierholzer | Euler tours in | Euler Tours |
| Hirschberg | LCS / alignment in linear space | Sequence DP |
| Hoeffdingâs lemma | tail bounds for bounded independent variables | Probability and Expectation |
| Hollow heap | simple heap with Fibonacci-heap bounds | Heaps |
| HopcroftâKarp | bipartite matching | Bipartite Matching |
| HopcroftâTarjan | linear DFS: biconnectivity, triconnectivity, planarity | Special Graph Classes |
| Hornerâs rule | evaluate a polynomial with multiplications | Root Finding and Integration |
| Horspoolâs algorithm | simplified BoyerâMoore with one shift table | Other Matching |
| Hungarian (KuhnâMunkres) | assignment problem | Assignment Problem |
| HuntâSzymanski | LCS in with matching pairs | LIS, LCS and Edit Distance |
| HuâShing | matrix-chain multiplication | Interval DP |
| HuâTucker | optimal alphabetic code tree | Knuth-Yao Optimization |
| HyperLogLog | distinct count with relative error â 1.04/âm | Sampling and Streaming |
I
| Name | What it does | Note |
|---|---|---|
| Irvingâs algorithm | stable roommates | Stable Matching |
| ItaiâPapadimitriouâSzwarcfiter | Hamiltonian paths in grid graphs | Hamiltonian Paths and TSP |
J
| Name | What it does | Note |
|---|---|---|
| Jensenâs inequality | for convex , mean of (reverse for concave) | đŹ Formula |
| Johnson | all-pairs shortest paths with reweighting | Shortest Paths |
| JonkerâVolgenant | fast shortest-augmenting-path assignment | Assignment Problem |
| Josephus problem | survivor recurrence and the jump | Classic Puzzles |
K
| Name | What it does | Note |
|---|---|---|
| Kacâs lemma | expected return time in a Markov chain | Probability and Expectation |
| Kadane | maximum subarray | Classic Array Problems |
| Kahnâs algorithm | BFS topological sort by in-degree | DAGs and Topological Sort |
| KaltofenâShoup | subquadratic distinct-degree factorization | Polynomial Factorization |
| Karatsuba multiplication | 3 half-size products, O(n^1.585) | Fast Fourier Transform |
| Karatsuba | multiplication in | FFT |
| Karger, KargerâStein | randomized global min cut | Global Min Cut |
| KargerâKleinâTarjan | randomized linear-time MST | Theoretical Algorithms Catalog |
| KarivâHakimi | absolute 1-center of a graph | Minimum Spanning Trees |
| KarlinâKleinâOveis Gharan | -approximation for metric TSP | Approximation Algorithms |
| KarmarkarâKarp (differencing) | largest-differencing heuristic for number partitioning | Scheduling and Partitioning |
| Karpâs minimum mean cycle | minimum mean-weight cycle in | Shortest Path Techniques |
| KarpâMillerâRosenberg naming | prefix doubling: O(1) equality of substrings | Suffix Array |
| KarpâMillerâRosenberg | prefix doubling for suffix arrays / naming | Suffix Array and LCP |
| Kasai | LCP array from a suffix array in | Suffix Array |
| Kasaiâs algorithm | LCP array from the suffix array in O(n) | Suffix Array |
| Kasteleynâs formula | domino tilings via a Pfaffian | Broken Profile DP |
| KawarabayashiâThorup | deterministic near-linear min cut in simple graphs | Global Minimum Cut |
| Kayles | remove 1 or 2 adjacent pins; Grundy period 12 from 71 | SpragueâGrundy |
| KingâRaoâTarjan | deterministic max flow in for dense graphs | Theoretical Algorithms Catalog |
| KinoshitaâLi composition | f(g(x)) mod x^n in O(n log^2 n) via power projection | Composition and Taylor Shift |
| Kirkman triple system | resolvable Steiner triple system; exists iff | Kirkmanâs Schoolgirls |
| KirkpatrickâSeidel | âultimateâ convex hull in | Convex Hull |
| Kitamasaâs method | n-th term of a linear recurrence in O(k^2 log n) | Linear Recurrences |
| KleitmanâKwiatkowski bound | a Fitch Cheney trick with cards exists iff the deck has at most cards | Fitch Cheney Trick |
| KMP (prefix function) | pattern matching, borders, periods | Prefix Function and Z |
| KnuthâMorrisâPratt algorithm | linear-time matching with the prefix function | Prefix Function and Z |
| KnuthâMorrisâPratt | linear string matching with the prefix function | Prefix Function and Z-Function |
| KnuthâPlass | optimal line breaking (monotone DP) | Monotone Queue, 1D1D and SMAWK |
| KnuthâYao optimization | interval DP in | Knuth Optimization |
| KnuthâYao speedup | interval DP under the quadrangle inequality | Knuth-Yao Optimization |
| Kummerâs theorem | p-adic valuation of a binomial = number of carries | Binomial Identities |
| KönigâEgervĂĄry, KönigâOre | bipartite max matching = min vertex cover; deficiency formula | Bipartite Matching |
| Kosaraju, Tarjan SCC | strongly connected components | SCC and 2-SAT |
| Kruskal | MST with a DSU | MST |
| Kruskal reconstruction tree | bottleneck paths, reachability under thresholds | Kruskal Reconstruction Tree |
| Kuhn | bipartite matching by augmenting DFS | Bipartite Matching |
| Kuratowskiâs theorem | planar iff no or subdivision | Special Graph Classes |
L
| Name | What it does | Note |
|---|---|---|
| Lagrange interpolation | polynomial from point values | Interpolation |
| Lagrange inversion | coefficients of compositional inverses | Generating Functions |
| Lanczos algorithm | Krylov tridiagonalisation for symmetric eigenproblems | Sparse and Structured Matrices |
| LandauâVishkin | -differences matching in | LIS, LCS and Edit Distance |
| LarmoreâSchieber | concave 1D/1D DP in linear time | Monotone Queue, 1D1D and SMAWK |
| Laskerâs Nim | remove or split a heap; Grundy values swap within blocks of 4 | SpragueâGrundy |
| Legendreâs formula, Kummer, Lucas | prime powers in factorials and binomials | Factorials mod p |
| Lehmer code | permutation factorial number system, rank and unrank | Counting Fundamentals |
| LempelâEvenâCederbaum | st-numbering-based planarity test | Special Graph Classes |
| LempelâZiv | LZ77/LZ78 factorization and compression | Runs and Periodicity |
| Lenstra ECM | elliptic-curve factorization | Theoretical Algorithms Catalog |
| LenstraâLenstraâLovĂĄsz (LLL) | lattice basis reduction | Polynomial Factorization |
| LenstraâShmoysâTardos | 2-approximation for unrelated machine scheduling | Scheduling and Partitioning |
| Levenshtein distance | edit distance DP | LIS, LCS and Edit Distance |
| LichtenbergâThorup (Holmâde LichtenbergâThorup) | fully dynamic connectivity in amortized | Dynamic Connectivity |
| LindströmâGesselâViennot lemma | non-intersecting lattice paths as a determinant | Determinants |
| LindströmâGesselâViennot | non-intersecting lattice paths as a determinant | Determinants and Permanents |
| Linear conflict heuristic | Manhattan distance plus 2 per tile that must leave its line; admissible for sliding puzzles | Fifteen Puzzle |
| Link-cut tree | dynamic trees with path aggregates | Link-Cut Tree |
| LinâKernighan | variable-depth local search for TSP | Hamiltonian Paths and TSP |
| LiptonâTarjan | planar separator theorem, separators | Special Graph Classes |
| LPT scheduling | longest processing time first, (4/3 â 1/(3m))-approximate makespan | Approximation Algorithms |
| LucasâLehmer | primality test for Mersenne numbers | Primality Testing and Factorization |
| Lucy_Hedgehogâs algorithm | and prime sums in | Sublinear Sieves and Prime Counting |
| LUX method (Conway) | magic squares of order | Magic Squares |
M
| Name | What it does | Note |
|---|---|---|
| MacNeish construction | Kronecker products of orthogonal Latin squares | Latin Squares |
| MainâLorentz algorithm | all runs / tandem repeats in O(n log n) | Runs and Periodicity |
| MainâLorentz | all tandem repeats in | Runs and Periodicity |
| MalhotraâKumarâMaheshwari (MPM) | blocking-flow max flow | Maximum Flow |
| Mantelâs theorem | a triangle-free graph on vertices has at most edges (the case of TurĂĄn) | Constructive Algorithms |
| Manacher | all palindromic radii in | Palindromes |
| Manacherâs algorithm | all maximal palindromes in O(n) | Palindromes |
| ManberâMyers | suffix array by doubling | Suffix Array and LCP |
| Manhattan distance | ; MST and farthest pair via | Attacking a Problem |
| Matrix-tree theorem (Kirchhoff) | counting spanning trees | Matrix-Tree Theorem |
| McCreight | linear-time suffix tree | Theoretical Algorithms Catalog |
| Megiddoâs algorithm | 2D/3D linear programming in (prune and search) | Linear Programming |
| MeisselâLehmer | in about | Sublinear Sieves and Prime Counting |
| Mooreâs Nim | remove from up to k heaps; losing iff every bit column sums to 0 mod k+1 | Combinatorial Games and Nim |
| Myersâ bit-vector algorithm | edit distance in O(n m / w) | Other Matching |
| Ménage problem | seating couples alternately with no partners adjacent | Inclusion-Exclusion and Derangements |
| Mengerâs theorem | max disjoint paths = min cut | Minimum Cut |
| Mersenne numbers | , LucasâLehmer test | Primality Testing and Factorization |
| Mertensâ theorems | Primes and Sieves | |
| Metropolis criterion | acceptance rule in simulated annealing | Heuristic Optimization |
| MicaliâVazirani | general matching in | General Matching |
| MillerâRabin | deterministic 64-bit primality | Primality and Factorization |
| MillerâReif | parallel tree contraction (rake and compress) | Top Trees |
| Minkowski sum | sum of convex polygons in | Minkowski Sum |
| MisraâGries | heavy hitters, more than occurrences, in space | Classic Array Problems |
| Moâs algorithm (and variants) | offline range queries in | Moâs Algorithm |
| Möbius inversion | inclusionâexclusion over divisors | Arithmetic Functions |
| Monge condition | , which gives monotone argmins | Monotone Queue, 1D1D and SMAWK |
| Montgomery multiplication | division-free modular products | Barrett and Montgomery |
| MoonâMoser | a graph has at most maximal cliques | Maximum Clique and Independent Set |
| MooreâHodgson | minimise the number of late jobs | Scheduling and Partitioning |
| MooreâPenrose pseudoinverse | least-squares solutions | Root Finding and Integration |
| MuchaâSankowski | matching via Gaussian elimination in | General Matching |
| Mycielski construction | triangle-free graphs of any chromatic number | Constructive Algorithms |
N
| Name | What it does | Note |
|---|---|---|
| NagamochiâIbaraki | sparse -connectivity certificates | Global Min Cut |
| Nash-WilliamsâTutte | edge-disjoint spanning trees; arboricity formula | Matroids |
| NeedlemanâWunsch | global sequence alignment | LIS, LCS and Edit Distance |
| NemhauserâTrotter | half-integral vertex cover LP, kernel | Complexity Theory and NP-Hardness |
| NemhauserâWolseyâFisher | greedy gives for monotone submodular maximisation | Approximation Algorithms |
| Network simplex | fast practical min-cost flow | Min-Cost Flow |
| Newton iteration (power series) | inverse, log, exp, sqrt of a series in | Power Series Operations |
| Newtonâs identities | power sums elementary symmetric polynomials | Characteristic Polynomial |
| Newtonâs method (power series) | inverse, log, exp, sqrt of series | Power Series |
| NewtonâRaphson | quadratically convergent root finding | Root Finding and Integration |
| NewtonâSchulz iteration | matrix inverse with only multiplications, quadratic convergence | Root Finding and Integration |
| NewtonâSchulz | iterative matrix inverse | Root Finding and Integration |
| Non-adjacent form (NAF) | signed binary digits with no two adjacent non-zeros, minimal weight | Number Theory Miscellany |
| NTT | exact convolution modulo primes | NTT |
| Number-theoretic transform | exact FFT over Z_p with p = c 2^k + 1 | NTT |
O
| Name | What it does | Note |
|---|---|---|
| Oreâs theorem | for non-adjacent implies Hamiltonian | Hamiltonian Paths and TSP |
| Orlinâs algorithm | strongly polynomial min-cost flow; max flow | Theoretical Algorithms Catalog |
| Otterâs dissimilarity theorem | unlabelled free trees from rooted trees | Counting Graphs and Trees |
| Otterâs formula | counting unlabelled trees | Tree Isomorphism and PrĂŒfer Codes |
P
| Name | What it does | Note |
|---|---|---|
| Pairing heap | simple meldable heap, fast in practice | Heaps |
| Papadimitriouâs random walk | 2-SAT in O(nÂČ) expected flips | Randomized Search |
| Parallel binary search | many monotone searches at once | Parallel Binary Search |
| Pascalâs rule, Pascalâs triangle | Counting Fundamentals | |
| Pentagonal number theorem | partition numbers in O(n sqrt n); Franklinâs involution | Stirling, Bell and Partitions |
| Pisano period | period of Fibonacci numbers modulo m | Number Theory Miscellany |
| Power tower (generalized Euler theorem) | a^x ⥠a^(x mod Ï(m) + Ï(m)) mod m for x â„ Ï(m) | Number Theory Miscellany |
| Principal variation search (NegaScout) | null-window alpha-beta with re-search | Game Search |
| Proof-number search | best-first proof of a forced win with proof / disproof numbers | Game Search |
| PĂ©pinâs test | primality of Fermat numbers | Theoretical Algorithms Catalog |
| Persistent segment tree | versioned arrays, -th smallest in a range | Persistent Segment Trees |
| PettieâRamachandran | optimal (decision-tree-optimal) MST algorithm | Theoretical Algorithms Catalog |
| PicardâQueyranne | all minimum - cuts from a residual graph | Minimum Cut |
| Pickâs theorem | for lattice polygons | Polygons |
| Pigeonhole principle | objects in boxes; prefix sums mod | Invariants, Parity and Extremal Arguments |
| PohligâHellman | discrete log in a group of smooth order | Primitive Roots and Discrete Log |
| Pollardâs | factor when is smooth | Primitive Roots and Discrete Log |
| Pollardâs rho (Brent) | 64-bit factorization in | Primality and Factorization |
| Prim | MST in or | MST |
| Pushârelabel (HLPP) | max flow for dense / hard graphs | Push-Relabel |
Q
| Name | What it does | Note |
|---|---|---|
| q-Lucas theorem | q-binomials modulo p when q has small order | Stirling, Bell and Partitions |
| Quadratic sieve | subexponential factorization | Theoretical Algorithms Catalog |
R
| Name | What it does | Note |
|---|---|---|
| Radonâs theorem | any points in split into two sets whose convex hulls intersect | Linear Programming |
| Rabinâs irreducibility test | irreducibility over F_p via x^(p^n) - x | Polynomial Factorization |
| RabinâKarp algorithm | pattern matching with rolling hashes | String Hashing |
| RabinâKarp | rolling-hash matching | String Hashing |
| RabinâVazirani | randomized matching via the Tutte matrix | General Matching |
| Raderâs algorithm | prime-length DFT via cyclic convolution | Convolution Variants |
| RadoâEdmonds | greedy is optimal exactly on matroids | Matroids |
| RaghavanâThompson | randomized rounding with Chernoff bounds | Approximation Algorithms |
| Ramseyâs theorem | : any 2-colouring of âs edges has a monochromatic triangle, and generally is finite | Party Problem |
| Randomized rounding (RaghavanâThompson) | round an LP solution by treating values as probabilities | Approximation Algorithms |
| Rearrangement inequality | similarly ordered sequences maximise | Greedy and Exchange Arguments |
| ReedsâSloane algorithm | shortest linear recurrence modulo a composite | Linear Recurrences |
| ReedâSolomon | polynomial evaluation codes | Polynomial Factorization |
| ReedsâSloane | BerlekampâMassey modulo composite | Linear Recurrences |
| Reif | planar min cut / max flow via shortest paths in the dual | Theoretical Algorithms Catalog |
| Relaxed multiplication | online convolution in O(n log^2 n) | Online Convolution |
| Reservoir sampling (Algorithm R, Algorithm L) | uniform k-sample of a stream in O(k) memory | Sampling and Streaming |
| Retrograde analysis | win / loss / draw of a cyclic game graph backwards from terminal positions | Loopy Games |
| Robbinsâ theorem | strongly orientable iff 2-edge-connected | Bridges and Biconnectivity |
| Robinsonâs recurrence | counting labelled DAGs by inclusionâexclusion over sources | Counting Graphs and Trees |
| Rotating calipers | diameter, widths, antipodal pairs | Rotating Calipers |
| RSK correspondence, hook length formula | Young tableaux counting | Young Tableaux and RSK |
| Rule of three (peg solitaire) | diagonal 3-colouring parity invariant of peg solitaire | Peg Solitaire |
| Runs theorem | a string has fewer than maximal repetitions | Runs and Periodicity |
| Ryserâs formula | permanent in | Determinants and Permanents |
S
| Name | What it does | Note |
|---|---|---|
| SA-IS | suffix array in | Suffix Array |
| SchieberâVishkin | LCA after preprocessing | LCA |
| SchreierâSims algorithm | order and membership of a permutation group | Burnside and PĂłlya |
| SchwartzâZippel lemma | a non-zero degree-d polynomial vanishes at a random point with probability | Hashing and Verification |
| SchönhageâStrassen | integer multiplication in | Theoretical Algorithms Catalog |
| SchreierâSims | permutation group order and membership | Burnside and PĂłlya |
| SchroeppelâShamir | meet in the middle with memory | Meet in the Middle |
| SchwartzâZippel | a random point detects a nonzero polynomial with probability | Randomized Algorithms |
| Schwenkâs theorem | which boards admit a closed knightâs tour | Backtracking and Pruning |
| Schöningâs algorithm | random-walk 3-SAT in O((4/3)^n poly n) | Randomized Search |
| Secretary problem | optimal stopping, skip , success | Secretary Problem |
| Segment tree beats (Ji driver) | range chmin / chmax with sums | Segment Tree Beats |
| Seidelâs algorithm | randomized LP in fixed dimension, expected | Linear Programming |
| Seidelâs LP | randomized incremental LP in fixed dimension, expected O(d! n) | Linear Programming |
| SelfridgeâConway | envy-free cake cutting for 3 people with at most 5 cuts | Cake Cutting |
| ShamosâHoey | detect any segment intersection in | Sweep Line and Segment Intersections |
| SharirâWelzl | LP-type problems, randomized | Linear Programming |
| ShermanâMorrison formula | inverse after a rank-one update in O(n^2) | Sparse and Structured Matrices |
| ShermanâMorrison | rank-1 update of a matrix inverse | Sparse and Structured Matrices |
| Shoelace formula | polygon area from its vertex coordinates | Points, Vectors and Orientation |
| Siamese method | odd-order magic squares | Constructive Algorithms |
| Simpsonâs rule | adaptive numerical integration | Root Finding and Integration |
| Simulated annealing | Metropolis acceptance with a cooling schedule | Heuristic Optimization |
| Skew heap, leftist heap | meldable heaps in | Heaps |
| Skolem construction | Steiner triple system on points from a half-idempotent quasigroup | Kirkmanâs Schoolgirls |
| SleatorâTarjan | link-cut trees; splay trees | Link-Cut Tree |
| Slope trick | DP over convex piecewise-linear functions | Slope Trick |
| SMAWK | row minima of totally monotone matrices in | Monotone Optimizations |
| Smithâs rule | minimise weighted completion time: sort by | Scheduling and Partitioning |
| SmithâWaterman | local sequence alignment | LIS, LCS and Edit Distance |
| SOS DP (zeta / Möbius transform) | sums over subsets in | Submasks and SOS DP |
| Sparse table | idempotent range queries | Sparse Table |
| Spernerâs theorem | the largest antichain in has size | Modular Arithmetic |
| SPFA | BellmanâFord with a queue | Shortest Paths |
| Splay tree | self-adjusting BST, amortized | Treaps and Balanced BSTs |
| SpragueâGrundy | impartial game sums | Sprague-Grundy |
| Staircase Nim | Nim on the odd-indexed steps | Combinatorial Games and Nim |
| Stanley sequence | greedy 3-AP-free sequence (base-3 digits) | Constructive Algorithms |
| SternâBrocot simplest fraction | smallest-denominator fraction in an interval in O(log) via continued fractions | Big Integers and Fractions |
| SternâBrocot tree | rationals, best approximations | Continued Fractions |
| Stirling numbers | cycles (first kind) and set partitions (second kind) | Stirling, Bell and Partition Numbers |
| Stirlingâs approximation | đŹ Formula | |
| StoerâWagner | deterministic global min cut | Global Min Cut |
| Strassenâs algorithm | matrix product with 7 block multiplications, O(n^2.807) | Matrices and Matrix Power |
| Strategy stealing | the first player wins (Chomp, Hex) without an explicit strategy | Chomp and Hex |
| Subproduct tree | multipoint evaluation and interpolation in O(n log^2 n) | Evaluation and Interpolation |
| Suffix automaton | all substrings in states | Suffix Automaton |
| Surreal numbers | Conwayâs numbers as game values | Hackenbush and Partizan Games |
| SutherlandâHodgman | clip a polygon against a convex polygon | Polygons |
| Suurballeâs algorithm | edge-disjoint shortest paths of minimum total length | K Shortest and Disjoint Paths |
| Sweep line (BentleyâOttmann) | segment intersections | Sweep Line |
| Swinnerton-Dyer polynomials | worst case for Zassenhaus factorization | Polynomial Factorization |
| Sylvesterâs identity | determinant identity behind Bareiss elimination | Determinants and Permanents |
| SylvesterâGallai | non-collinear points have an ordinary line | Invariants, Parity and Extremal Arguments |
T
| Name | What it does | Note |
|---|---|---|
| Tabu search | local search with a memory of forbidden moves | Heuristic Optimization |
| Tango tree | -competitive BST | Fast Set and Integer Structures |
| Tarjan bridges / articulation points | lowlink | Bridges and Biconnectivity |
| Tarjan offline LCA | LCA with a DSU | LCA |
| TarjanâVishkin | biconnected components via spanning-tree connectivity | Bridges and Biconnectivity |
| TarjanâWerneck | self-adjusting top trees | Top Trees |
| TarjanâYannakakis | maximum cardinality search, chordality test | Special Graph Classes |
| Thomas algorithm | tridiagonal systems in O(n) | Sparse and Structured Matrices |
| ThueâMorse anti-hash | strings of length 2^11 collide under every polynomial hash mod 2^64 | Hashing and Verification |
| ThueâMorse sequence | parity of popcount; breaks hashes mod | String Hashing |
| ToomâCook | split-into-3 multiplication | Fast Fourier Transform |
| Top tree | dynamic trees with path and subtree data | Top Trees |
| Touchardâs formula | mĂ©nage problem count via rook numbers on a cycle | InclusionâExclusion |
| Toussaintâs rotating calipers | width, diameter and bounding boxes of convex polygons | Rotating Calipers |
| Treap | randomized balanced BST, implicit keys | Treaps |
| Trygub numbers | big numbers with digits allowed to go negative, updates | Modular Arithmetic |
| Tsinâs algorithm | 3-edge-connected components | Bridges and Biconnectivity |
| TurĂĄnâs theorem, TurĂĄn graph | max edges without a | Constructive Algorithms |
| TutteâBerge formula | max matching | General Matching |
| Two-SAT | implication graph + SCC | SCC and 2-SAT |
U
| Name | What it does | Note |
|---|---|---|
| Ukkonen | suffix tree online | Suffix Tree |
| Ukkonenâs algorithm | online suffix tree construction | Suffix Tree |
V
| Name | What it does | Note |
|---|---|---|
| van Emde Boas tree | predecessor in | Fast Set and Integer Structures |
| Vandermondeâs identity | Binomial Identities | |
| Vertex geography (GallaiâEdmonds) | first player wins iff every maximum matching covers the start | Games on Graphs |
| Vizingâs theorem | chromatic index is or ; constructive edge-colouring by fan rotations | Graph Coloring |
W
| Name | What it does | Note |
|---|---|---|
| WalshâHadamard transform | xor / and / or convolutions | Bitwise Convolutions |
| Warnsdorffâs rule | knightâs tour heuristic: fewest onward moves first | Backtracking and Pruning |
| WedderburnâEtherington numbers | unlabelled binary rooted trees | Tree Isomorphism and PrĂŒfer Codes |
| WeilerâAtherton | clip general (non-convex) polygons | Polygons |
| Weinerâs algorithm | first linear-time suffix tree | Theoretical Algorithms Catalog |
| Weiszfeldâs iteration | geometric median | Minimum Enclosing Circle |
| Welzl | minimum enclosing circle in expected | Minimum Enclosing Circle |
| Wiedemannâs algorithm | sparse solve / determinant via Krylov sequence + BerlekampâMassey | Sparse and Structured Matrices |
| Wilsonâs algorithm | uniform spanning tree by loop-erased random walks | Matrix-Tree Theorem |
| Wilsonâs sliding-puzzle theorem | on a 2-connected bipartite graph (not a cycle or ) sliding tokens realise exactly the even permutations | Fifteen Puzzle |
| Wilsonâs theorem | Factorials and Binomials mod p | |
| Winding number | point in polygon for self-intersecting polygons | Polygons |
| Worpitzkyâs identity | powers as sums of Eulerian numbers times binomials | Stirling, Bell and Partitions |
| WuâManber | hashed multi-pattern shift matching | Theoretical Algorithms Catalog |
| Wythoffâs game | losing positions | Sprague-Grundy |
Y
| Name | What it does | Note |
|---|---|---|
| Yaoâs minimax principle | lower bounds for randomized algorithms | Complexity Theory and NP-Hardness |
| Yenâs algorithm | shortest simple paths | K Shortest and Disjoint Paths |
| Yunâs algorithm | square-free decomposition | Polynomial Factorization |
Z
| Name | What it does | Note |
|---|---|---|
| Z-algorithm | longest common prefix with every suffix in O(n) | Prefix Function and Z |
| Z-function | longest common prefix with every suffix | Prefix Function and Z |
| Zassenhaus | factor integer polynomials via Hensel lifting | Polynomial Factorization |
| Zeckendorf representation | unique sum of non-consecutive Fibonacci numbers, found greedily | Number Theory Miscellany |
| Zermeloâs theorem | every finite two-player perfect-information game is determined: one player has a forced win, or both can force at least a draw; backward induction (minimax) finds which | Game Search |
| Zeller / misc date and number tricks | see the formula list | đŹ Formula |
| Zobrist hashing | XOR of random keys per state component | Randomized Algorithms |
| Zsigmondyâs theorem | for coprime , has a prime factor dividing no earlier , except a few small cases | â |