Read the algorithm posts in this order. Easier ideas come first. When two ideas are about as hard, the one people meet more often comes first.
The number in a post address is the order it was published. It is not this order. The number at the start of each line is the reading order.
Start here
Seventeen posts. A scan, a hash table, one sort, walking a graph, one dynamic program, one greedy choice, the gcd, the sieve, a shuffle, and a cache.
- 1. Linear search — find a key by scanning each item once
- 2. Hash table — look up a key in the slot its hash names
- 3. How binary search maintains a half-open range
- 4. How insertion sort charges one move per inversion
- 5. How breadth-first search measures unweighted distance
- 6. How depth-first search records discovery and finish
- 7. How Kadane resets a running sum
- 8. How activity selection takes the earliest finish
- 9. How the Euclidean algorithm divides out a gcd
- 10. How the sieve of Eratosthenes strikes composites
- 11. How LRU replaces the least recently used page
- 12. How Fisher-Yates shuffles with one swap per index
- 13. How bubble sort finishes one suffix item per pass
- 14. How selection sort bounds the number of writes
- 15. How fractional knapsack packs by value density
- 16. How round-robin shares a processor by a quantum
- 17. How the Boyer-Moore vote finds a majority candidate
Next
The rest of a first course: mergesort, quicksort, heaps, shortest paths, spanning trees, knapsack, and the cryptography people meet by name.
- 18. How jump search blocks a sorted array
- 19. How mergesort keeps a stable n log n bound
- 20. How quicksort recurses after a partition
- 21. How a binary heap sifts in an array
- 22. How Dijkstra grows a settled shortest-path tree
- 23. How Bellman-Ford relaxes every edge V minus 1 times
- 24. How Floyd-Warshall closes all-pairs distances
- 25. How Kruskal adds the cheapest safe edge
- 26. How Prim grows a minimum spanning tree from a cut
- 27. How topological sort orders a directed acyclic graph
- 28. How union-find almost flattens a disjoint-set forest
- 29. How PageRank iterates a damped link matrix
- 30. How 0-1 knapsack fills a capacity row
- 31. How the longest common subsequence fills a grid
- 32. How Levenshtein distance fills an edit grid
- 33. How Huffman coding merges the two lightest trees
- 34. How Gaussian elimination reaches row echelon form
- 35. How Newton’s method updates a root by the tangent
- 36. How gradient descent steps against the gradient
- 37. How Lloyd’s algorithm runs k-means
- 38. How Diffie-Hellman agrees on a shared secret
- 39. How RSA encrypts with a public exponent
- 40. How CBC chains ciphertext into the next plaintext block
- 41. How HMAC-SHA-256 mixes a key into a hash
- 42. How heapsort sorts in place in n log n
- 43. How counting sort places integers from a histogram
- 44. How radix sort orders keys one digit at a time
- 45. How quickselect finds one order statistic
- 46. How a trie stores keys on a path from the root
- 47. How A* orders expansion by f equals g plus h
- 48. How Gale-Shapley builds a stable matching
- 49. How unbounded knapsack reuses a capacity row
- 50. How weighted intervals choose by dynamic programming
- 51. How Rabin-Karp rolls a hash across the text
- 52. How binary exponentiation squares a power
- 53. How the extended Euclidean algorithm writes Bezout
- 54. How the Chinese remainder theorem builds a residue
- 55. How Floyd’s cycle algorithm meets a tortoise and a hare
- 56. How the Graham scan builds a convex hull
- 57. How ray casting tests a point in a polygon
- 58. How a Bloom filter records membership in bits
- 59. How consistent hashing places keys on a ring
- 60. How two-phase commit records one decision
- 61. How counter mode turns AES into a keystream
- 62. How PBKDF2 stretches a password by repeating HMAC
- 63. How MD5 compresses a padded message
- 64. How SHA-1 compresses a padded message
- 65. How reservoir sampling keeps a uniform subset
- 66. How minimax values a perfect-information game
Standard course
Balanced trees, string matching, max flow, and the algorithms behind common libraries. Read these after the two bands above, or filter by the idea you need.
- 67. How exponential search brackets a nearby key
- 68. How interpolation search places the next probe
- 69. How ternary search narrows a unimodal function
- 70. How Shellsort chooses a gap sequence
- 71. How bucket sort uses a uniform spread
- 72. How bidirectional BFS meets in the middle of a path
- 73. How Hierholzer builds an Eulerian circuit
- 74. How Kahan summation keeps a running correction
- 75. How Bresenham rasters a line with integer steps
- 76. How Cohen-Sutherland clips a segment with outcodes
- 77. How Jarvis march wraps a convex hull
- 78. How Peterson’s algorithm locks two threads
- 79. How the banker’s algorithm tests a safe state
- 80. How the clock algorithm approximates LRU
- 81. How RC4 generates a keystream from a permutation
- 82. How Triple DES encrypts with three DES operations
- 83. How AES encrypts one block in ten rounds
- 84. How SHA-256 compresses a padded message
- 85. How square-root decomposition sums a range by blocks
- 86. How Fibonacci search splits on Fibonacci sizes
- 87. How cycle sort writes each item to its final index
- 88. How introsort caps quicksort with a heap
- 89. How timsort merges natural runs
- 90. How a red-black tree fixes insert with colors
- 91. How an AVL tree restores height balance
- 92. How a B-tree keeps every leaf at one depth
- 93. How a B+ tree stores keys in a linked leaf level
- 94. How a segment tree answers a range query
- 95. How a Fenwick tree sums a prefix
- 96. How Fleury avoids burning a bridge early
- 97. How Edmonds-Karp bounds augmentations with BFS
- 98. How Ford-Fulkerson augments residual paths
- 99. How Kosaraju uses a transpose graph
- 100. How Tarjan finds strongly connected components
- 101. How matrix-chain order minimizes scalar multiplications
- 102. How Shannon-Fano splits symbols by weight
- 103. How Knuth-Morris-Pratt skips with the prefix table
- 104. How Boyer-Moore skips with the bad-character rule
- 105. How LZ77 points back into a sliding window
- 106. How LZW grows a dictionary of phrases
- 107. How Miller-Rabin tests a strong pseudoprime
- 108. How the closest pair of points searches a strip
- 109. How ECDH multiplies a shared elliptic-curve point
- 110. How ECDSA signs a hash on an elliptic curve
- 111. How ChaCha20 expands a key into a keystream block
- 112. How GCM authenticates ciphertext with GHASH
- 113. How X25519 multiplies a point on Curve25519
- 114. How Monte Carlo tree search balances a game tree
- 115. How iterative deepening DFS saves the frontier
- 116. How external mergesort sorts beyond memory
- 117. How a skip list stacks random linked lists
- 118. How a treap uses random priorities
- 119. How a sparse table answers a static range minimum
- 120. How 0-1 BFS uses a deque for weights zero and one
- 121. How binary lifting computes a lowest common ancestor
- 122. How Tarjan finds bridges and articulation points
- 123. How Kuhn matches by augmenting DFS
- 124. How Karger contracts a random min-cut
- 125. How an optimal BST weights search cost
- 126. How meet-in-the-middle splits a subset sum
- 127. How the egg dropping recurrence limits the worst case
- 128. How the Viterbi algorithm decodes a hidden path
- 129. How Needleman-Wunsch aligns two sequences globally
- 130. How Smith-Waterman aligns two sequences locally
- 131. How Manacher mirrors palindrome radii
- 132. How the Z-algorithm boxes previous prefix matches
- 133. How the Burrows-Wheeler transform sorts rotations
- 134. How Karatsuba multiplies with three half-size products
- 135. How the linear sieve marks each composite once
- 136. How power iteration extracts a dominant eigenvalue
- 137. How Strassen multiplies matrices with seven products
- 138. How Andrew’s algorithm builds a monotone chain
- 139. How DBSCAN grows a density cluster
- 140. How RANSAC fits a model to inliers
- 141. How simulated annealing accepts an uphill move
- 142. How a count-min sketch estimates a frequency
- 143. How HyperLogLog estimates a cardinality
- 144. How MinHash estimates a Jaccard similarity
- 145. How earliest deadline first schedules one processor
- 146. How rate-monotonic scheduling assigns fixed priorities
- 147. How DES encrypts a block with sixteen Feistel rounds
- 148. How DSA signs a hash in a prime-order subgroup
- 149. How ElGamal encrypts a message as a pair of powers
- 150. How HKDF extracts and expands a shared secret
- 151. How OAEP encodes a short message before the RSA exponent
- 152. How Poly1305 authenticates a message under a one-time key
- 153. How scrypt stretches a password with a large table
- 154. How Shamir sharing reconstructs a secret by interpolation
- 155. How alpha-beta pruning cuts a minimax tree
Later
Harder, or less often met. Read a post here when that area is the one you want.
- 156. How IDA* deepens an f-cost bound
- 157. How patience sorting finds increasing subsequences
- 158. How Boruvka merges components by their cheapest edge
- 159. How Dial’s algorithm buckets integer distances
- 160. How HITS scores hubs and authorities
- 161. How SPFA queues Bellman-Ford relaxations
- 162. How Tarjan answers LCA queries offline
- 163. How bitap matches a pattern with word shifts
- 164. How Brent’s cycle search resets on powers of two
- 165. How Cooley-Tukey splits a discrete Fourier transform
- 166. How the simplex algorithm pivots a linear program
- 167. How Misra-Gries tracks heavy hitters
- 168. How Lamport’s bakery algorithm takes a ticket
- 169. How rendezvous hashing picks the highest score
- 170. How Blowfish builds its state from the digits of pi
- 171. How Ed25519 signs a message on an Edwards curve
- 172. How Mo’s algorithm orders offline range queries
- 173. How median of medians selects in linear time
- 174. How Dinic blocks a level graph
- 175. How Hopcroft-Karp phases bipartite matching
- 176. How Johnson reweights edges and runs Dijkstra
- 177. How the Hungarian algorithm solves an assignment
- 178. How Held-Karp holds one subset per tour
- 179. How Aho-Corasick matches many patterns at once
- 180. How Kasai builds the LCP array from a suffix array
- 181. How prefix doubling builds a suffix array
- 182. How arithmetic coding narrows a fraction
- 183. How conjugate gradient solves a symmetric positive system
- 184. How GJK tests two convex shapes for overlap
- 185. How expectation-maximization alternates two steps
- 186. How Metropolis-Hastings samples a target density
- 187. How SHA-3 absorbs a message into a Keccak sponge
- 188. How a binomial heap merges in logarithmic time
- 189. How a Fibonacci heap makes decrease-key cheap
- 190. How a splay tree moves the accessed node to the root
- 191. How Brandes accumulates betweenness
- 192. How Bron-Kerbosch lists maximal cliques
- 193. How Christofides approximates a metric tour
- 194. How push-relabel moves preflow downhill
- 195. How Stoer-Wagner finds a global min-cut
- 196. How successive shortest paths price a min-cost flow
- 197. How Pollard’s rho hunts a factor on a cycle
- 198. How baby-step giant-step solves a discrete log
- 199. How Chan’s algorithm hulls in n log h time
- 200. How rotating calipers walk antipodal pairs
- 201. How Bentley-Ottmann sweeps segment intersections
- 202. How Fortune’s algorithm sweeps a Voronoi diagram
- 203. How Welzl encloses points in a disk
- 204. How Earley’s algorithm parses a general grammar
- 205. How the CYK algorithm parses a Chomsky grammar
- 206. How smoothsort adapts a heap to sorted input
- 207. How the Lucas-Lehmer test checks a Mersenne number
- 208. How the blossom algorithm matches a general graph
- 209. How Ukkonen builds a suffix tree online
- 210. How the AKS test proves primality in polynomial time
- 211. How a van Emde Boas tree searches in log log universe
- 212. How Edmonds finds a minimum arborescence
- 213. How Tonelli-Shanks takes a square root mod p
本文由 HoHo 與 AI 協作整理,最後更新於 2026 年 11 月 20 日。
