All 804 articles, sorted alphabetically
2-Edge-Connected Components + Bridge Tree
Group vertices connected without using bridges. Tree structure of bridges.
Read article →A* Algorithm
Add h(n) estimate to guide search. Optimal + admissible = optimal path.
Read article →A* Pathfinding
Optimal shortest path with heuristic guidance. Basis of game AI + robotics.
Read article →A* Variants
Memory-bounded, anytime, and dynamic replanning A* variants.
Read article →Activity Selection
Sort by end time + take non-conflicting activities. Provable optimality.
Read article →AES-GCM
Counter-mode AES + GHASH universal hash. Parallel + hardware accelerated.
Read article →AES
Rijndael, 128/192/256-bit keys, 10/12/14 rounds. Backbone of modern symmetric crypto.
Read article →Aho-Corasick
Trie + failure links = search for many patterns in text in linear time.
Read article →2D Geometry Algorithms
Foundational 2D geometry algorithms: orientation, distance, intersection, area.
Read article →2-SAT
How 2-SAT (SAT with 2-variable clauses) is solvable in polynomial time via SCC.
Read article →3-SAT Reduction
3-SAT: canonical NP-hard SAT variant.
Read article →A* Search Deep Dive
A* pathfinding: f(n) = g(n) + h(n).
Read article →A* Variants
The variants of A* for different constraints: memory-bounded, anytime, weighted.
Read article →Accounting Method for Amortized
Accounting amortized analysis.
Read article →AES Deep Dive
AES: symmetric block cipher.
Read article →Aggregate Method for Amortized
Aggregate amortized analysis.
Read article →Aho-Corasick Algorithm
Aho-Corasick multi-pattern search.
Read article →Alias Method
Alias method: sample from discrete distribution in O(1).
Read article →Alpha-Beta Pruning
Alpha-beta pruning for minimax.
Read article →Amortized Analysis
Amortized analysis: average per-operation cost.
Read article →ANS Coding
Asymmetric Numeral Systems.
Read article →Approximation Algorithms
How approximation algorithms give provable bounds on optimal solutions to NP-hard problems.
Read article →APX-Hard Problems
APX-hardness: problems with no PTAS.
Read article →ARC architecture
Deep-dive on ARC, the Adaptive Replacement Cache that beats LRU and LFU by adapting the recency-versus-frequency balance automatically per workload, w…
Read article →Argon2
Argon2: modern memory-hard password hash.
Read article →Arithmetic Coding
Arithmetic coding: entropy-optimal compression.
Read article →Articulation Points (Cut Vertices)
Find vertices whose removal disconnects graph.
Read article →AVL Tree
How AVL trees maintain balance via height difference limits and rotations.
Read article →AVL Tree
Self-balancing AVL tree.
Read article →B+ Tree
B+ tree for on-disk sorted data.
Read article →B-Tree
B-tree: multi-way branching for disk-optimized search.
Read article →Backtracking
How backtracking systematically explores solution spaces, prunes branches that can't succeed, and solves N-Queens, Sudoku, and co…
Read article →Bellman-Ford
How Bellman-Ford computes shortest paths in O(VE), handling negative edges.
Read article →Bellman-Ford Deep Dive
Bellman-Ford shortest paths deep dive.
Read article →BFS and DFS
How breadth-first and depth-first search traverse graphs, when to use each, and applications from shortest path to cycle detection.
Read article →Biconnected Components
Decompose graph into biconnected components.
Read article →Bidirectional Search
Search from both source and target.
Read article →Big-O Notation
How Big-O notation describes worst-case time and space complexity, why constants and lower-order terms drop, and how to reason about scalability.
Read article →2D Binary Indexed Tree
How 2D BIT extends BIT for grid range queries.
Read article →Binary Search Tree Deep Dive
BST: fundamental ordered dictionary structure.
Read article →Bipartite Matching
How to find max matching in bipartite graphs via max flow or Hopcroft-Karp.
Read article →Bit Hacks Catalog
Reference catalog of bit hacks.
Read article →Bit Manipulation Fundamentals
Core bit manipulation operations for algorithms.
Read article →Bitboards for Chess
Bitboards: 64-bit int per piece type.
Read article →Bitmask DP
How bitmask DP handles problems with small subsets (n ≤ 20).
Read article →Bloom filter architecture
Deep-dive on Bloom filter architecture: hash family, sizing math, counting and cuckoo variants, and the ops layer for production use.
Read article →Bloom Filter
How Bloom filters test set membership with false positives but no false negatives, using little memory.
Read article →Bloom Filter Deep Dive
Bloom filter: probabilistic set membership.
Read article →Bloom Filter Variants
Counting + partitioned + scalable Bloom filters.
Read article →Borůvka's Algorithm
Borůvka's algorithm: parallelizable MST computation.
Read article →Boyer-Moore String Matching
Boyer-Moore: sub-linear in practice.
Read article →Boyer-Moore Deep Dive
Boyer-Moore string search deep dive.
Read article →Bridges (Cut Edges) in Graphs
Find edges whose removal disconnects graph.
Read article →Brotli Compression
Brotli compression algorithm.
Read article →BSP
BSP model: alternating compute + comm supersteps.
Read article →Burrows-Wheeler Transform
BWT: reversible transform for compression.
Read article →Burrows-Wheeler Transform Deep
BWT deep dive.
Read article →Centroid Decomposition
How centroid decomposition enables efficient tree query algorithms.
Read article →Chinese Remainder Theorem
Solve systems of modular congruences.
Read article →Christofides Algorithm
Christofides algorithm for metric TSP.
Read article →Chromatic Number + Chromatic Polynomial
Chromatic number and polynomial: coloring counts.
Read article →Clique NP-Hardness Reduction
3-SAT to Clique reduction proves clique NP-hard.
Read article →Closest Pair of Points
Divide-and-conquer O(n log n) closest pair.
Read article →Count-Min Sketch Architecture in Depth
A 2500-word walkthrough of Count-Min Sketch: d × w counter matrix, hash functions, insert + query, overestimate math, parameters, applications, varian…
Read article →Combinatorics
How to count arrangements: permutations, combinations, Catalan numbers, inclusion-exclusion.
Read article →Computational Biology Algorithms
Overview of algorithms in computational biology.
Read article →Consistent hashing architecture
Deep-dive on consistent hashing: ring, virtual nodes, replica walk, bounded loads, Anchor/Jump/Rendezvous variants, and cluster management.
Read article →Convex Hull
How convex hull algorithms (Graham scan, Andrew's monotone chain) compute in O(n log n).
Read article →3D Convex Hull
3D convex hull: O(n log n) with QuickHull.
Read article →Convex Optimization
Convex optimization: efficiently solvable.
Read article →Count-Min Sketch
How Count-Min Sketch estimates frequencies in streams using little memory.
Read article →Count-Min Sketch Deep Dive
Count-Min sketch for frequency estimation.
Read article →Count Sketch
Count sketch for streaming frequency.
Read article →Count-Min sketch architecture
Deep-dive on Count-Min sketch: d hash functions, w counters per row, increment, min query, error bound, merge, conservative update.
Read article →Cuckoo Filter
Cuckoo filter: modern Bloom alternative.
Read article →Cuckoo filters
Deep-dive on cuckoo filters: partial-key cuckoo hashing and the i2 = i1 XOR hash(fp) involution, fingerprint sizing and the 2b/2^f false-positive math…
Read article →Cuckoo Hashing
Cuckoo hashing: O(1) worst-case lookup dynamic.
Read article →D* / D* Lite
D* Lite: incremental replanning for robot navigation.
Read article →De Bruijn Graph Assembly
De Bruijn graphs for genome assembly.
Read article →Delaunay Triangulation
Delaunay: max-min-angle triangulation.
Read article →Delta Encoding
Delta encoding: store differences.
Read article →Derandomization
Convert randomized to deterministic algorithms.
Read article →Diffie-Hellman Key Exchange
DH: classic key exchange.
Read article →Digit DP
How digit DP counts numbers ≤ N satisfying properties.
Read article →Dijkstra's Algorithm
How Dijkstra's algorithm finds shortest paths, why it needs non-negative weights, and the priority-queue implementation for O((V+…
Read article →Dinic's Algorithm
How Dinic's algorithm achieves O(V²E) max flow using level graphs and blocking flows.
Read article →Dinic's Max Flow
Dinic's max flow algorithm.
Read article →Discrete Logarithm Problem
DLP: find x such that g^x = h mod p.
Read article →DiskANN architecture
Deep-dive on DiskANN: the Vamana low-diameter graph, product-quantized guidance in RAM with full vectors on disk, beam search and exact re-rank, alpha…
Read article →Distributed Consensus Architecture: Raft, Paxos, and Beyond
A 2500-word walkthrough of a modern consensus system: client, coordinator, leader, log, followers, state machines, and snapshots.
Read article →Divide and Conquer
How divide-and-conquer solves problems by splitting them, solving subproblems recursively, and combining results. Master theorem for complexity.
Read article →Coin Change DP
Coin change: min coins + count ways DP.
Read article →Edit Distance
Levenshtein distance: min edits between strings.
Read article →Egg Drop Puzzle DP
Egg drop: min trials to find critical floor.
Read article →0/1 Knapsack DP
0/1 knapsack: max value under weight limit.
Read article →Longest Common Subsequence
LCS: DP for longest common subsequence.
Read article →Longest Increasing Subsequence
LIS: O(n log n) via patience sorting.
Read article →Matrix Chain Multiplication
Matrix chain: optimal parenthesization DP.
Read article →Optimal BST
Optimal BST: DP with Knuth optimization.
Read article →Rod Cutting DP
Rod cutting: max revenue from cutting rod.
Read article →Wildcard Pattern Matching DP
Wildcard matching: * and ? patterns.
Read article →DSU on Tree (Small-to-Large)
How small-to-large merging enables efficient subtree queries.
Read article →Dynamic Graph Connectivity
Dynamic connectivity algorithms.
Read article →Dynamic Programming
How dynamic programming solves problems by breaking into overlapping subproblems and storing results, and the classic patterns.
Read article →ECC Deep Dive
ECC: elliptic curve cryptography.
Read article →ECDH
ECDH: Diffie-Hellman on elliptic curves.
Read article →Ed25519
Ed25519: modern signature scheme.
Read article →Edge-Disjoint Paths
Max edge-disjoint paths via max flow.
Read article →Edit Distance
Edit distance (Levenshtein).
Read article →Edmonds-Karp
How Edmonds-Karp uses BFS for augmenting paths, giving O(VE²) worst case.
Read article →Edmonds-Karp Deep Dive
Edmonds-Karp: BFS-based max flow O(VE^2).
Read article →Edmonds' Blossom Algorithm
Edmonds' blossom for max matching.
Read article →Ellipsoid Algorithm
Ellipsoid method: polynomial LP algorithm.
Read article →Entropy Coding Overview
Overview of entropy coding methods.
Read article →Epoch-Based Reclamation
Epoch-based GC for lock-free.
Read article →Euclidean Algorithm
Euclid's algorithm for GCD.
Read article →Euler Totient Function
Count integers coprime to n; core number-theoretic tool.
Read article →Euler Tour on Tree
Euler tour: linearize tree for range queries.
Read article →Exchange Argument
Exchange argument: proving greedy optimality.
Read article →Expander Graphs
Expanders: sparse yet well-connected graphs.
Read article →Expected Value in Algorithms
How expected value analysis rigorously bounds randomized algorithm behavior.
Read article →Expectimax
Expectimax: minimax with expected value at chance nodes.
Read article →Extended Euclidean Algorithm
Extended Euclidean: find u, v with au + bv = gcd(a, b).
Read article →Fenwick Tree (BIT)
How Fenwick trees (Binary Indexed Trees) enable O(log n) point updates and prefix sum queries with less overhead than segment trees.
Read article →Fenwick tree architecture
Deep-dive on the Fenwick tree (binary indexed tree): the range each cell owns via lowbit(i) = i & -i, upward-walking updates a…
Read article →Fast Fourier Transform
How FFT computes polynomial multiplication in O(n log n) via frequency domain transformation.
Read article →FFT Deep Dive
Implementation details of Cooley-Tukey FFT.
Read article →Fibonacci Heap
Fibonacci heap for Dijkstra.
Read article →Algorithms: Choosing the Right Tool
Choosing the right algorithm for the job.
Read article →Finger Search
Finger search: O(log d) for nearby search.
Read article →Fixed-Point Arithmetic
Fixed-point for deterministic decimal math.
Read article →Advanced Flow Networks
Extensions to flow networks: vertex capacities, lower bounds, gomory-hu trees.
Read article →Floyd-Warshall
How Floyd-Warshall computes all-pairs shortest paths in O(V³) via dynamic programming.
Read article →Floyd-Warshall Deep Dive
Floyd-Warshall all-pairs shortest paths.
Read article →Ford-Fulkerson Deep Dive
Ford-Fulkerson max flow algorithm.
Read article →Futexes
Fast userspace mutexes (futex).
Read article →Gale-Shapley Deep Dive
Gale-Shapley: stable matching foundation.
Read article →Game Theory
Foundational game theory algorithms: minimax, Grundy numbers, alpha-beta pruning.
Read article →Gaussian Elimination
Solve linear systems Ax = b in O(n^3).
Read article →Genetic Algorithms
How genetic algorithms optimize via crossover + mutation of candidate solutions.
Read article →Gomory-Hu Tree
Gomory-Hu: all-pairs min-cuts via n-1 max-flows.
Read article →GPU-Specific Algorithms
Algorithm design for GPU architecture.
Read article →Gradient Descent Convergence
How to analyze gradient descent convergence: convex vs non-convex, smooth vs non-smooth.
Read article →Gradient Descent Theory
Convergence theory for gradient descent.
Read article →Grammar-Based Compression
Grammar compression: rewrite as CFG.
Read article →Graph Coloring
The graph coloring problem, its NP-hardness, and practical heuristics (greedy, backtracking).
Read article →Gray Code
Reflected binary Gray code and applications.
Read article →Greedy Algorithms
How greedy algorithms make locally-optimal choices, when they yield globally optimal solutions, and classic examples (Huffman, Dijkstra).
Read article →Activity Selection
Activity selection: max non-overlapping activities.
Read article →Dijkstra Deep
Dijkstra as greedy algorithm.
Read article →Fractional Knapsack
Fractional knapsack: greedy by value/weight ratio.
Read article →Gas Station Circular Problem
Circular tour: greedy first-station selection.
Read article →Huffman Coding
Huffman: optimal prefix code via greedy.
Read article →Interval Scheduling
Weighted vs unweighted interval scheduling.
Read article →Job Sequencing with Deadlines
Job sequencing: profit + deadlines greedy.
Read article →Meeting Rooms
Min meeting rooms: greedy + PQ.
Read article →Half-Plane Intersection
Half-plane intersection: O(n log n) convex polygon.
Read article →Hall's Marriage Theorem
Hall's theorem: bipartite matching characterization.
Read article →Halting Problem
Turing's undecidable halting problem.
Read article →Hamiltonian Path NP-Hard Reduction
Reduce 3-SAT to Hamiltonian path.
Read article →Hash Tables
How hash tables provide O(1) average lookup, collision resolution strategies (chaining, open addressing), and load factor tuning.
Read article →Hazard Pointers
Hazard pointers for memory reclamation.
Read article →Heap Operations
How binary heaps implement priority queues in O(log n), the heapify trick, and applications from Dijkstra to scheduling.
Read article →Heavy Hitters
Heavy hitter algorithms: Misra-Gries, Space-Saving, CountSketch.
Read article →Heavy-Light Decomposition
How heavy-light decomposition enables O(log² n) path queries + updates on trees.
Read article →Heavy Path Decomposition Deep Dive
How heavy path decomposition enables efficient tree queries.
Read article →Hirschberg's Algorithm
Space-efficient sequence alignment.
Read article →HITS Algorithm
HITS: hubs + authorities link analysis.
Read article →HKDF
HKDF: derive keys from shared secrets.
Read article →HyperLogLog
How HyperLogLog estimates unique count using O(log log n) memory via hash bit-pattern analysis.
Read article →HyperLogLog Algorithm Architecture in Depth
A 2500-word walkthrough of HyperLogLog: hash function, bucketing, rank via leading zeros, harmonic mean estimator, bias correction, merge, space-error…
Read article →HyperLogLog Streaming Applications
HLL in streaming systems: Kafka, Redis, analytics.
Read article →HNSW architecture
Deep-dive on HNSW: layered proximity graphs, greedy descent and efSearch beam search, geometric level assignment, the diversity neighbor heuristic, fi…
Read article →Hopcroft-Karp
Hopcroft-Karp: max bipartite matching in O(E sqrt V).
Read article →Hopscotch Hashing
Hopscotch hashing: cache-friendly open addressing.
Read article →Hungarian Algorithm
How Hungarian algorithm solves weighted bipartite matching in O(V³).
Read article →HyperLogLog
HyperLogLog: approximate cardinality with tiny memory.
Read article →HyperLogLog architecture
Deep-dive on HyperLogLog: bucket + leading zeros, registers, harmonic-mean estimate, error bound, merge, sparse/dense, HLL++.
Read article →HyperLogLog Deep Dive
HyperLogLog for distinct counting.
Read article →IEEE 754 Floating Point
IEEE 754 format and pitfalls.
Read article →Interior Point Methods
Interior point: polynomial LP + convex optimization.
Read article →Integer Programming Hardness
IP: NP-hard general integer programming.
Read article →Integer Programming and LP
How Integer Programming (IP) and Linear Programming (LP) solve constrained optimization.
Read article →Iterative Deepening Search
Iterative deepening: DFS at increasing depths.
Read article →IVF-PQ vector index architecture
Deep-dive on the IVF-PQ approximate nearest-neighbor index: coarse quantization and inverted lists (nlist/nprobe), product quantization into per-subsp…
Read article →Johnson's Algorithm
Johnson's algorithm: all-pairs shortest paths in sparse graphs.
Read article →Johnson's Algorithm
How Johnson's algorithm computes all-pairs shortest paths in graphs with negative edges.
Read article →Johnson's Algorithm
Johnson's algorithm for all-pairs shortest paths.
Read article →Jump Point Search
JPS: accelerated A* on uniform-cost grids.
Read article →Karatsuba Multiplication
Multiply n-digit numbers in O(n^1.585).
Read article →Karmarkar's Algorithm
Karmarkar's LP algorithm.
Read article →Karp Reductions
Poly-time many-one reductions.
Read article →KD-Tree Range Queries
How KD-trees answer range + nearest neighbor queries in multi-dimensional space.
Read article →KD-Tree
How KD-trees enable nearest-neighbor and range queries in multi-dimensional space.
Read article →KMP Algorithm
How the Knuth-Morris-Pratt algorithm finds a pattern in text in O(n+m) by precomputing a failure function.
Read article →KMP Algorithm Deep Dive
Knuth-Morris-Pratt algorithm deep dive.
Read article →Knapsack Problem
The 0/1 knapsack problem: pick items to maximize value under weight constraint. DP solution.
Read article →König's Theorem
König's theorem: min vertex cover = max matching in bipartite.
Read article →Kruskal's MST Deep Dive
Kruskal's algorithm with union-find optimizations.
Read article →Kth Order Statistics
Kth smallest / largest problems.
Read article →Lagrangian Duality
Lagrangian: constrained convex optimization.
Read article →Las Vegas Algorithms
Las Vegas: always correct, random runtime.
Read article →Lowest Common Ancestor
How LCA queries find lowest common ancestor of two nodes in tree efficiently.
Read article →LCA via Binary Lifting
Lowest common ancestor via binary lifting: O(log n) query.
Read article →LCP Array
LCP array: complements suffix array.
Read article →Longest Common Subsequence
How LCS finds the longest common subsequence via O(mn) DP, and its role in diff and version control.
Read article →Leftist Heap
Leftist heap: mergeable priority queue.
Read article →Lifelong Planning A* (LPA*)
LPA*: reuse search under changing edge costs.
Read article →Line Sweep Algorithms
Line sweep: process events in coordinate order.
Read article →Linear Sieve
Linear sieve: O(n) prime generation.
Read article →Link-Cut Trees Deep Dive
Link-cut trees: dynamic forest operations.
Read article →Link-Cut Trees
How Link-Cut trees maintain forest of trees under link + cut in O(log n) amortized.
Read article →Lock-Free Data Structures
Lock-free algorithms via CAS.
Read article →Lock-Free Queues
Lock-free queue algorithms.
Read article →Lock-Free Stack
Lock-free stack algorithms.
Read article →LP Duality
Linear programming duality theorem.
Read article →LP Rounding for Approximation
Round fractional LP solutions to integer.
Read article →Simplex Algorithm
Simplex: pivoting through vertices to solve LP.
Read article →LRU cache architecture
Deep-dive on LRU cache: hash map + linked list, admission policies (TinyLFU), concurrency, TTL, weighted entries, variants.
Read article →LSM Tree Compaction Architecture in Depth
A 2500-word walkthrough of LSM compaction: memtable → SSTables, STCS/LCS/TWCS strategies, triggers, throttling, and read/write/space amplification.
Read article →LSM-Tree
How LSM-trees enable write-optimized storage in Cassandra, RocksDB, LevelDB.
Read article →LSM Tree Deep Dive
Log-structured merge tree deep dive.
Read article →LSM trees vs B-trees
Deep-dive on LSM trees vs B-trees: in-place read-optimized B-trees vs append-merge write-optimized LSM trees, write/read/space amplification, compacti…
Read article →LZ4 Compression
LZ4 compression algorithm.
Read article →LZ78 Compression
LZ78: dictionary-tree compression.
Read article →Manacher's Algorithm
Manacher's palindrome algorithm.
Read article →MapReduce Model
MapReduce: partition + map + reduce.
Read article →Matrix Exponentiation
Solve linear recurrences in O(k^3 log n) via matrix power.
Read article →Matrix Exponentiation
How matrix exponentiation computes linear recurrences in O(log n) via matrix power.
Read article →Matroid Theory + Greedy
Matroid characterization when greedy is optimal.
Read article →Matroid Intersection
Matroid intersection algorithm.
Read article →Matroids
How matroids characterize when greedy algorithms work optimally.
Read article →Maximum Clique Problem
Find largest complete subgraph — NP-hard.
Read article →Maximum Independent Set
Largest vertex set with no edges — dual of max clique.
Read article →General Graph Matching
How Edmonds' blossom algorithm finds max matching in general (non-bipartite) graphs.
Read article →General Graph Matching
Maximum matching in general graphs (not just bipartite).
Read article →Monte Carlo Tree Search Deep Dive
MCTS: sampling-based tree search for games + planning.
Read article →Median of Medians
Deterministic O(n) selection via median-of-medians pivot.
Read article →Meet in the Middle
How meet-in-the-middle technique solves problems in O(2^(n/2)) instead of O(2^n).
Read article →Mergesort
How mergesort divides, sorts, and merges. Why it's stable, why it's the choice for linked lists, and how it …
Read article →Merkle trees -- efficient verification of large data
Deep-dive on Merkle trees: hashing data blocks into leaves and up to a single root, tamper evidence (any change alters the root), O(1) root comparison…
Read article →Miller-Rabin Primality Test
Miller-Rabin: probabilistic primality test.
Read article →Min Cost Max Flow
How min-cost max-flow finds max flow at minimum edge cost.
Read article →Min-Cut / Max-Flow Theorem
Fundamental theorem: max flow equals min cut in any network.
Read article →Minimum Spanning Arborescence
How to find minimum spanning arborescence (rooted directed spanning tree).
Read article →Minimax Deep Dive
Minimax algorithm foundation.
Read article →Mo's Algorithm
How Mo's algorithm answers many offline range queries in O((n+q)√n).
Read article →Möbius Function + Inversion
Möbius function + inversion for number-theoretic sums.
Read article →Modular Exponentiation
Fast modular exponentiation via square-and-multiply.
Read article →Monte Carlo Algorithms
Monte Carlo: fixed time, may err.
Read article →Moving Percentile / Median
Moving percentile / median over stream.
Read article →Multiplicative Weights
Multiplicative weights update method.
Read article →Needleman-Wunsch Global Alignment
Global sequence alignment DP.
Read article →Negamax Framework
Negamax: cleaner minimax formulation.
Read article →NP-Complete Problems
NP-Complete class + Cook-Levin theorem.
Read article →NP-Completeness
How NP-complete problems relate; reductions; approximation strategies for intractable problems.
Read article →NP-Hard Problems
NP-Hard class: at least as hard as NP-Complete.
Read article →Number Theoretic Transform
FFT over finite fields for exact polynomial multiplication.
Read article →Number Theory Algorithms
The essential number theory algorithms for competitive programming and cryptography.
Read article →Advanced Number Theory
Advanced number theory: Miller-Rabin primality, Pollard rho factorization, discrete log.
Read article →Offline LCA
How Tarjan's offline LCA algorithm uses DSU for near-linear LCA queries.
Read article →Offline Query Processing
How offline query processing sorts + batches queries for efficiency.
Read article →Online Algorithms
How online algorithms make irrevocable decisions without knowing the future.
Read article →Online LCA
How online LCA queries work: Euler tour + RMQ.
Read article →Online Learning Framework
Online learning: predict + observe + update loop.
Read article →Optimization Landscape
How the shape of the optimization landscape affects algorithm choice.
Read article →PageRank Deep Dive
PageRank: Google's link analysis.
Read article →Pairing Heap
Pairing heap alternative.
Read article →Pairwise Independence
Pairwise independent hash families.
Read article →Parallel BFS
Parallel breadth-first search.
Read article →Parallel Matrix Multiplication
Parallel matmul: SUMMA + Cannon + 2.5D.
Read article →Parallel Prefix Sum (Scan)
Prefix sum in O(log n) parallel time.
Read article →Parallel Sorting
Parallel sort: bitonic + radix + merge.
Read article →Parameterized Complexity
Parameterized complexity: exact algorithms in parameter k.
Read article →Partial Sort
Partial sort: sort first K only.
Read article →PBKDF2
PBKDF2: derive keys from passwords.
Read article →PCP Theorem
PCP theorem: hardness of approximation foundation.
Read article →Perfect Hashing
Perfect hashing: O(1) worst-case for static sets.
Read article →Persistent Data Structures
How persistent data structures allow modifications while preserving old versions via structural sharing.
Read article →Persistent Union-Find
Persistent DSU: versioned union-find.
Read article →Persistent Segment Tree
How persistent segment trees support queries on historical versions.
Read article →Persistent Segment Tree Deep Dive
Persistent segment trees for historical queries.
Read article →Persistent Treap
How persistent treaps enable versioned sequence operations.
Read article →Planar Graph Algorithms
How algorithms exploit planar graph structure for better complexity.
Read article →Planarity Testing
Test if graph can be drawn without edge crossings.
Read article →Point in Polygon
Ray casting: O(n) point-in-polygon test.
Read article →Pollard's Rho Factorization
Pollard's rho: probabilistic factorization O(n^1/4).
Read article →Polygon Algorithms
Key polygon algorithms: area (shoelace), point-in-polygon (ray casting), triangulation (ear clipping).
Read article →Polygon Area
Shoelace: O(n) polygon area.
Read article →Polynomial Hashing
How polynomial rolling hash enables fast string comparison.
Read article →Population Count
Popcount algorithms and hardware support.
Read article →Potential Method for Amortized
Potential function amortized analysis.
Read article →Personalized PageRank
PPR: PageRank with personalization vector.
Read article →PRAM Model
PRAM: parallel random access machine.
Read article →Prim's MST Deep Dive
Prim's algorithm with binary + Fibonacci heaps.
Read article →Sieve of Eratosthenes
How the Sieve of Eratosthenes generates primes up to N in O(n log log n) time.
Read article →PRM
PRM: sampling-based roadmap for multi-query planning.
Read article →Probabilistic Counting
Probabilistic counting for distinct elements.
Read article →Probability in Algorithms
How probability powers randomized algorithms (quicksort, hashing, primality) with strong guarantees.
Read article →Probability DP
How DP computes expected values over probabilistic transitions.
Read article →PTAS and FPTAS
How PTAS (Polynomial-Time Approximation Scheme) gets arbitrarily close to optimal.
Read article →PTAS and FPTAS Approximation Schemes
Polynomial-time approximation schemes.
Read article →Push-Relabel Algorithm
Push-relabel max flow algorithm.
Read article →Quadratic Residues
Testing + computing quadratic residues mod p.
Read article →Quicksort
How quicksort partitions around a pivot and recursively sorts, why it's O(n log n) average, and how to avoid O(n²) worst case.
Read article →Quotient Filter
Quotient filter: cache-friendly approximate set.
Read article →The quotient filter
Deep-dive on the quotient filter: splitting a key's hash into a quotient (home slot) and a stored remainder, the three metada…
Read article →R-Tree
How R-trees index spatial objects via bounding rectangle hierarchies, powering GIS databases.
Read article →Rabin-Karp String Search
Rabin-Karp rolling hash search.
Read article →Rabin-Karp Deep Dive
Rabin-Karp: rolling hash for pattern matching.
Read article →Random Permutation
Random permutation generation.
Read article →Random Selection
Random selection algorithms.
Read article →Random Walks
Random walks on graphs.
Read article →Randomized Quicksort
Randomized quicksort: expected O(n log n) regardless of input.
Read article →Randomized Rounding
How randomized rounding turns LP solutions into integer solutions.
Read article →Range Coder
Range coder: integer arithmetic coding.
Read article →Range Updates + Point Queries
How to handle range updates and point queries efficiently via difference arrays.
Read article →Rank + Select Structures
Rank + select data structures.
Read article →RCU (Read-Copy-Update)
RCU synchronization pattern.
Read article →Red-Black Tree
How red-black trees use color rules to maintain balance with less rotation than AVL.
Read article →Red-Black Tree
Red-Black: loosely balanced BST for TreeMap.
Read article →Regular Expressions
How regular expressions work (NFA/DFA), and the practical patterns that keep them fast and correct.
Read article →Rendezvous hashing architecture
Deep-dive on rendezvous hashing (HRW): argmax over hash(key, node), replication, weighted, skeleton, comparison with consistent hashing.
Read article →Reservoir sampling architecture
Deep-dive on reservoir sampling: Algorithm R, Vitter variants, weighted A-Res, distributed merge, streaming APIs, use cases.
Read article →Reservoir Sampling
Reservoir sampling for streaming uniform samples.
Read article →Reservoir sampling
Deep-dive on reservoir sampling (Algorithm R): drawing k items uniformly at random from a stream of unknown length in a single forward pass with O(k) …
Read article →Reverse-Delete Algorithm
Reverse-delete: MST by removing edges in decreasing order.
Read article →Ribbon filter architecture
Deep-dive on the ribbon filter: a static approximate-membership structure that encodes the key set as a solved banded linear system over GF(2), reachi…
Read article →Roaring bitmaps -- compressed bitmaps that stay fast
Deep-dive on roaring bitmaps: the bitmap dilemma (fast but big, or small but slow), chunking the integer space by the high 16 bits, the three adaptive…
Read article →RRT
RRT: sampling-based planning for high-dim spaces.
Read article →Run-Length Encoding
RLE: encode runs of same value.
Read article →SAT Reduction Technique
Reducing to SAT: encoding problems as SAT.
Read article →SAT Solving
How modern SAT solvers (DPLL, CDCL) handle NP-hard boolean satisfiability efficiently in practice.
Read article →Saturating Arithmetic
Saturating arithmetic clamps at range limits.
Read article →Kosaraju's SCC Algorithm
Kosaraju: strongly connected components via two DFS.
Read article →Segment Intersection
Bentley-Ottmann: O((n + k) log n) segment intersection.
Read article →Segment Tree
How segment trees enable range sum, min, max queries in O(log n), and how lazy propagation supports range updates.
Read article →Segment Tree with Lazy Propagation Deep Dive
How lazy propagation enables efficient range updates on segment tree.
Read article →Selection Algorithms
Selection algorithms overview.
Read article →Selection + Medians Deep Dive
Selection algorithms + medians deep dive.
Read article →Seqlock
Seqlock synchronization primitive.
Read article →Set Cover Greedy
Greedy algorithm for min set cover.
Read article →SHA-3 (Keccak)
SHA-3: modern hash function.
Read article →Fisher-Yates Shuffle
Deep dive on Fisher-Yates shuffle.
Read article →Sieve of Eratosthenes Deep Dive
Sieve: enumerate primes up to n.
Read article →Simplex Algorithm
How Simplex algorithm solves LP by moving along vertices of feasible polytope.
Read article →Simulated Annealing
How simulated annealing escapes local optima via probabilistic acceptance.
Read article →Skip List
Skip list probabilistic sorted structure.
Read article →Skip list architecture
Deep-dive on skip lists: levels, level selection, search, insert/delete, concurrent variants, range iterators, memory, use cases.
Read article →Sliding Window Minimum
Sliding window minimum with deque in O(n).
Read article →Snappy Compression
Snappy compression algorithm.
Read article →Sorting Networks
Sorting networks: fixed comparison structure.
Read article →Space-Saving architecture
Deep-dive on the Space-Saving algorithm for approximate top-k heavy hitters: a fixed table of k counters, the increment-or-evict-the-minimum rule that…
Read article →Splay Tree
Splay tree self-adjusting BST.
Read article →Splay Trees Deep Dive
Splay trees: self-adjusting BSTs.
Read article →Splay Trees
How splay trees achieve O(log n) amortized without balance information.
Read article →Square Root Decomposition
How √n bucketing enables efficient range queries and updates.
Read article →Sqrt Tree
How sqrt tree enables O(1) range queries with O(n log log n) memory.
Read article →Stable Marriage
How Gale-Shapley finds stable matching between two groups with preferences.
Read article →Stable Matching
Gale-Shapley: stable marriage / matching in O(n^2).
Read article →Stoer-Wagner Min-Cut
Stoer-Wagner: deterministic global min-cut.
Read article →Streaming Algorithms
How streaming algorithms process data in one pass with sub-linear memory.
Read article →String Matching
The main string matching algorithms (naive, KMP, Boyer-Moore, Rabin-Karp) and when to use each.
Read article →KMP String Matching Deep Dive
Knuth-Morris-Pratt: linear-time string matching.
Read article →Succinct Bitvectors
Succinct: near-optimal space bitvectors.
Read article →Suffix Array
Suffix array data structure.
Read article →Suffix Tree
Suffix tree deep dive.
Read article →Tabu Search
How tabu search avoids revisiting recent solutions to escape local optima.
Read article →Tarjan's SCC Algorithm
Tarjan's strongly connected components.
Read article →t-digest architecture
Deep-dive on the t-digest quantile sketch: (mean, count) centroids, the scale function that warps cluster sizes to keep the tails sharp, the compressi…
Read article →Ternary Search
How ternary search finds max/min of unimodal function in O(log n).
Read article →Theta*
Theta*: any-angle path smoothing during search.
Read article →Tonelli-Shanks Algorithm
Tonelli-Shanks: square root mod prime.
Read article →Top-K / heavy hitters -- finding the most frequent in a stream
Deep-dive on top-K / heavy-hitter algorithms: the most-frequent-items problem, why exact counting is memory-prohibitive, Space-Saving (bounded counter…
Read article →Top-K in Streams
Top-K frequent items in streams.
Read article →Top Trees
Top trees: hierarchical decomposition.
Read article →Topological Sort
How topological sort orders DAG nodes so every edge goes forward, using DFS or Kahn's algorithm.
Read article →Transactional Memory
Software and hardware transactional memory.
Read article →Transposition Tables
Transposition tables: cache seen positions in game search.
Read article →Treap
How treaps combine BST + heap using random priorities for probabilistically balanced tree.
Read article →Treap Deep Dive
Treap: BST + heap by random priority.
Read article →Persistent Treaps
Persistent treaps: versioned treaps.
Read article →Tree DP
How to solve tree problems via DP over subtrees.
Read article →Trie
How tries store strings by prefix for fast lookup and autocomplete, and when to use them versus hash maps.
Read article →TSP Approximation Algorithms
Approximation algorithms for TSP.
Read article →TSP via Dynamic Programming
Held-Karp DP for exact TSP in O(n^2 * 2^n).
Read article →Two's Complement
Two's complement signed integers.
Read article →UCT
UCT: UCB1 applied to MCTS selection.
Read article →Undecidable Problems
Undecidable: no algorithm can decide.
Read article →Union-Find
How union-find (disjoint set union) supports near-O(1) merge and query operations via path compression and union by rank.
Read article →Universal Hashing
Universal hash families for collision bounds.
Read article →van Emde Boas Tree
van Emde Boas tree for integer sets.
Read article →Vertex Cover Approximation
2-approximation for min vertex cover.
Read article →Visibility Graph
Visibility graph for shortest paths around polygons.
Read article →Voronoi Diagrams
Voronoi: regions closest to sites.
Read article →Wavelet Tree
How wavelet trees enable k-th element + rank queries on ranges.
Read article →Wavelet Tree Deep Dive
Wavelet tree: succinct + rank/select.
Read article →Weighted Reservoir Sampling
Weighted reservoir sampling for streams.
Read article →Work Stealing
Work-stealing schedulers.
Read article →X-Fast Trie
X-fast trie for integer sets.
Read article →XOR Filter
XOR filter: modern approximate membership.
Read article →Y-Fast Trie
Y-fast trie for integer sets.
Read article →Z Algorithm
Z algorithm for string matching.
Read article →Zobrist Hashing
Zobrist: incremental board position hashing.
Read article →Zstd Compression
Zstandard compression algorithm.
Read article →All-Pairs Shortest Paths
Floyd-Warshall O(V³). Johnson O(V²log V + VE). Sub-cubic via Seidel, Zwick.
Read article →Signed Area of Polygon
Sum of cross products. Sign indicates orientation.
Read article →Art Gallery Theorem
Simple polygon with N vertices needs at most ⌊N/3⌋ guards to see all interior.
Read article →Attention Mechanism
Weight input positions by learned relevance. Backbone of GPT + BERT + all modern LLMs.
Read article →AVL Tree
Height-balanced BST with left/right rotations to maintain balance factor.
Read article →B+ Tree
All data in leaves, leaves linked. Sequential scans are trivial.
Read article →B-Tree
M-ary tree with keys per node = disk page size. Foundation of most database indexes.
Read article →Balanced Binary Tree Check
Is the tree height-balanced? O(N) with early termination.
Read article →Bayesian Optimization
Gaussian Process posterior + acquisition function. Sample-efficient black-box optimization.
Read article →Bellman-Ford
V-1 rounds of edge relaxation. Detects negative cycles.
Read article →Bellman-Ford
Slower than Dijkstra but handles negative edges and detects negative cycles.
Read article →BERT
Masked language model + next-sentence prediction. Sparked LLM era.
Read article →Betweenness Centrality
Fraction of shortest paths through vertex. Brandes: O(VE) instead of O(V³).
Read article →Breadth-First Search
BFS visits nodes in level order. Watch it happen with a queued animation.
Read article →BFS on Grids
Grid-specific BFS: 4/8-connectivity, boundary tricks, virtual super-node.
Read article →BFS on Implicit Graphs
Graph too large to materialize. Generate neighbors on the fly.
Read article →BFS with Augmented State
Node = (position, extra info). Grid + keys, TSP-like, portal problems.
Read article →0-1 BFS
Deque replaces PQ. Edges of weight 0 push to front, weight 1 to back.
Read article →Binary Tree In-Order Traversal
Left → Root → Right visits nodes in sorted order (for BSTs). Watch the animation.
Read article →Binary Tree Level-Order Traversal (BFS)
Visit nodes level by level with a queue. Powers view problems + zigzag.
Read article →Binary Tree Post-Order Traversal
Left → Right → Root. Perfect for tree deletion + expression evaluation.
Read article →Binary Tree Pre-Order Traversal
Root → Left → Right. Perfect for serialization + tree copying.
Read article →Bipartite Check
Bipartite iff no odd cycle. BFS 2-color test in O(V+E).
Read article →Bipartite Matching
Match items across two sets. Bipartite specialization + weighted assignment.
Read article →Bitap Algorithm
Bit tricks for pattern matching with errors. Fast for short patterns.
Read article →Bloom Filter
K hash functions + bit array. Definitely-not-in vs probably-in. Massive space savings.
Read article →Blossom Algorithm
Edmonds' blossom shrinking. Non-bipartite maximum matching in O(V·E·α(V)).
Read article →Bounded Knapsack
Each item has a limit. Handled via binary decomposition to reduce to 0/1.
Read article →Boyer-Moore
Fast pattern match in practice. Sublinear expected on random text.
Read article →Bridge Detection
Detect bridges as edges added. Fully online via link-cut trees.
Read article →Bridges + Articulation Points (Tarjan's)
Find critical edges/nodes whose removal disconnects graph. Single DFS.
Read article →BST Insert + Search + Delete Operations
Binary search tree fundamentals with animated insertion.
Read article →BST Validation
Recursively check each node against inherited bounds.
Read article →Build Binary Tree From Two Traversals
Preorder + Inorder OR Postorder + Inorder uniquely determines a tree.
Read article →Burrows-Wheeler Transform
BWT rearranges string to be more compressible. Basis of bzip2 + FM-index.
Read article →Cactus Graphs
Structured graph class where many NP-hard problems become polynomial.
Read article →Cartesian Tree
Build tree where in-order = array + heap property on values. Enables O(1) RMQ.
Read article →Catalan Numbers
C_n = C(2n, n) / (n+1). Counts binary trees, balanced parens, etc.
Read article →Katz Centrality
Sum over paths of length k, weighted by α^k. Generalizes eigenvector centrality.
Read article →Centroid Decomposition
Recursively split tree at centroid. Each level halves subtree size. O(log N) levels.
Read article →ChaCha20-Poly1305
Stream cipher + universal-hash MAC. Fast in software, no side-channels.
Read article →Chinese Postman Problem
Find shortest tour visiting every edge. Reduces to Eulerian + matching.
Read article →Batched CRT
Compute mod several small primes → combine via CRT. Avoids big-integer cost.
Read article →Chinese Remainder Theorem
System x ≡ aᵢ (mod nᵢ) has unique solution mod ∏nᵢ if all nᵢ coprime.
Read article →Personalized PageRank
PageRank biased toward preferred nodes. Foundation of recommendations.
Read article →SCC Condensation
Contract each SCC to node → DAG. Enables DP on SCCs.
Read article →Chordal Graphs
Perfect elimination ordering enables polynomial algorithms for many problems.
Read article →Chromatic Polynomial
P(G, k) = number of proper k-colorings. Deletion-contraction recurrence.
Read article →Chu-Liu-Edmonds
MST for directed graphs. Contracts min-in-edge cycles iteratively.
Read article →Circular Linked List
Last node points back to head. Uses in scheduling + streaming.
Read article →Circulation Problem
Each edge has lower + upper capacity bounds. Reduce to max-flow.
Read article →Closest Pair of Points
Sort by x, recurse, merge with strip check.
Read article →Convolutional Neural Networks
Weight sharing + local receptive fields. Image processing before ViT.
Read article →Coin Change
Count ways to make amount N using unlimited coins. DP.
Read article →CGAL + GEOS + Boost.Geometry
Robust geometry code is hard. Use libraries.
Read article →Connected Components
Iterate unvisited vertices, DFS from each. Component count.
Read article →Constrained Shortest Path
Minimize cost subject to resource budget. NP-hard, DP or Lagrangian.
Read article →Continued Fractions
Represent real as a₀ + 1/(a₁ + 1/(a₂ + …)). Convergents give best approximations.
Read article →Contraction Hierarchies
Precompute node ordering + shortcuts. Query in ms on billion-node graphs.
Read article →Andrew's Monotone Chain
Sort by x, build lower + upper hulls with cross-product tests.
Read article →Convex Hull
Smallest convex polygon containing all points. Sort by angle + linear stack scan.
Read article →QuickHull
Analog of quicksort. Expected O(N log N), worst O(N²).
Read article →Convex Layers
Compute hull, remove, repeat. All layers in O(N log N).
Read article →Convex Polygon Intersection
Two convex polygons: intersect in linear time via O'Rourke's chase algorithm.
Read article →Deep Copy List with Random Pointer
Copy list where each node has next + arbitrary random pointer.
Read article →Cycle Detection in Directed Graph
DFS with 3-color coloring: back edge = cycle. Or topological sort success.
Read article →Cycle Detection
Two-pointer meeting in cycle. O(N) time, O(1) space.
Read article →Cycle Detection in Undirected Graph
DFS: any edge to non-parent visited vertex = cycle. Union-Find alternative.
Read article →DBSCAN
Cluster = dense regions. Handles arbitrary shapes + noise. No k needed.
Read article →Decision Trees
Recursive binary splits minimizing impurity. Foundation of RF + GBDT.
Read article →DeepWalk
Predecessor to node2vec. Uniform walks + skip-gram. Foundation of graph embedding era.
Read article →Delaunay Triangulation
Triangulate points such that no point lies inside any triangle's circumcircle.
Read article →Depth-First Search
DFS goes deep before wide. Foundation of topological sort, cycle detection, and more.
Read article →DFS Tree
During DFS, edges classify as tree, back, forward, cross. Foundation of many algorithms.
Read article →Dial's Algorithm
Bucket queue instead of PQ. O(E + V×C) for max weight C.
Read article →Diffie-Hellman
Alice + Bob agree on shared secret via public messages. No prior sharing needed.
Read article →Digital Signatures
Non-repudiation + integrity + authenticity. Foundation of PKI + software distribution.
Read article →Bidirectional Dijkstra
Run Dijkstra from source AND target. Meet in middle. 2x+ speedup.
Read article →Dijkstra's Algorithm
Single-source shortest paths with non-negative weights. Priority queue + relaxation.
Read article →Dijkstra with Fibonacci Heap
Amortized O(1) decrease-key gives Dijkstra its theoretical best.
Read article →Dijkstra's Shortest Path
Priority queue + edge relaxation give shortest paths from source in weighted graphs.
Read article →Dijkstra with Potentials
Add potential function → shifted edge weights → efficient repeated queries.
Read article →Dinic's Algorithm
BFS to build level graph, DFS for blocking flow. O(V²·E). O(E·√V) on bipartite.
Read article →Dominator Tree
u dominates v iff every path from root passes u. Tree structure. Compilers use it.
Read article →Doubly Linked List
Prev + next pointers enable O(1) removal given node reference.
Read article →0/1 Knapsack Problem
The classic knapsack: fill a 2D DP table row by row.
Read article →Burst Balloons
Choose burst order to maximize coins. Reverse-thinking interval DP.
Read article →Coin Change
Min coins to make amount + count ways to make amount. Same problem, different DP.
Read article →Egg Drop Problem
Find minimum trials to identify critical floor with limited eggs.
Read article →Fibonacci
The canonical DP intro problem: recursion tree, memoization, tabulation, and space optimization.
Read article →House Robber Problem
Non-adjacent selection problem with elegant O(1) space.
Read article →Dynamic Programming
The four-step DP framework, visualized with a live-filling table.
Read article →Longest Common Subsequence (LCS)
Find the longest sequence appearing in both strings, in order.
Read article →Matrix Chain Multiplication
Optimal parenthesization for matrix multiplication order.
Read article →Maximum Subarray Sum
Elegant O(N) DP for max contiguous sum.
Read article →Optimal Binary Search Tree
Build a BST with minimum expected search cost given key frequencies.
Read article →Paint House Problem
Paint N houses with 3 colors, no two adjacent same. Classic state DP.
Read article →Palindrome Partitioning
Partition string into palindromes with minimum cuts. Two DPs combined.
Read article →Partition Equal Subset Sum
Can we partition array into two equal-sum subsets? Subset-sum problem.
Read article →Regular Expression Matching
Match string against pattern with . and * — 2D DP handles it elegantly.
Read article →Best Time to Buy and Sell Stock
Buy + sell with cooldown, transaction fee, or k transactions — state machine DP handles all.
Read article →Unique Paths in Grid
Number of paths from top-left to bottom-right, only moving right or down.
Read article →Word Break Problem
Can a string be segmented into dictionary words? 1D DP with substring lookups.
Read article →ECDSA
Elliptic curve version of DSA. Bitcoin + TLS use it. Requires cryptographic randomness.
Read article →Ed25519
Fast, secure, small signatures. Bernstein's design. SSH + JWT + modern protocols.
Read article →Edit Distance
Min insert/delete/replace to transform s into t. O(N·M) DP.
Read article →Edmonds-Karp
Ford-Fulkerson with shortest augmenting path (BFS). O(V·E²).
Read article →Eigenvector Centrality
Score = eigenvector of adjacency matrix. High score = connected to other high scores.
Read article →Elliptic Curve Cryptography (ECC)
Groups on elliptic curves enable smaller keys with same security. Standard in modern crypto.
Read article →Epidemic Models on Networks
How disease spreads via graph structure. Basic reproduction number R₀.
Read article →Euclidean Algorithm
Ancient algorithm. gcd(a, b) = gcd(b, a mod b). Foundation of number theory.
Read article →Euclidean MST
MST on complete graph of points. O(N log N) via Delaunay triangulation.
Read article →Euler's Totient Function
Number of integers in [1, n] coprime to n. Core of RSA.
Read article →Euler Tour Technique
Flatten tree into array via DFS enter/exit times. Range queries → subtree queries.
Read article →Eulerian Path
Find path using each edge exactly once. Linear time.
Read article →Expander Graphs
Constant-degree graphs with rapid mixing. Fundamental in CS + math.
Read article →Extended Euclidean Algorithm
Compute gcd + x, y such that a·x + b·y = gcd(a, b). Foundation of modular inverses.
Read article →Fast Fourier Transform (FFT)
Compute DFT in O(N log N). Foundation of signal processing + fast multiplication.
Read article →Fast Polynomial Multiplication
Multiply degree-N polynomials in O(N log N). Beats schoolbook O(N²).
Read article →Fenwick Tree (BIT)
Simpler than segment tree, same O(log N) prefix sums + point updates.
Read article →2D Fenwick Tree
BIT extended to 2D: O((log N)²) per op.
Read article →Fibonacci Computation
F_n in O(log n): matrix power or fast doubling.
Read article →Find Middle of Linked List
Single pass, two pointers. Slow ends at middle when fast hits end.
Read article →Finger Tree
2-3 tree variant with 'fingers' giving O(1) access to both ends.
Read article →Flood Fill
Fill connected region of same value. Paint bucket tool.
Read article →Floyd-Warshall
O(V³) DP over intermediate vertices. Works with negative weights (no negative cycles).
Read article →Fractional Cascading
Precompute pointers between sorted lists to eliminate repeated binary searches.
Read article →Fractional Knapsack
Sort by value/weight ratio, take highest ratio first. O(N log N).
Read article →Gabow's SCC Algorithm
Alternative to Tarjan's low-link. Uses two stacks, single DFS.
Read article →Game Tree Search
Two-player zero-sum games. Depth-limited search with pruning.
Read article →Gas Station Circular Route
Find starting station to complete circular route. Elegant O(N) greedy.
Read article →Girvan-Newman
Iteratively remove highest-betweenness edges. Reveals hierarchical community structure.
Read article →Gomory-Hu Tree
One tree encodes minimum s-t cut for every pair. N-1 max-flow calls.
Read article →GPT
Autoregressive next-token prediction. Foundation of ChatGPT/Claude/Gemini.
Read article →Gradient Boosting
Sequential boosting. Each tree fits residuals. Winner of most Kaggle tabular competitions.
Read article →Gradient Descent
First-order optimization. Foundation of neural network training.
Read article →Graph Attention Networks (GAT)
Attention over neighbors. Weights not uniform — learned per edge.
Read article →Graph Diameter
Max over all (u,v) of dist(u,v). Various tricks + approximations.
Read article →Graph Isomorphism
Determine if two graphs are structurally identical. Neither P nor NP-hard (unknown).
Read article →Graph Kernels
Kernel functions comparing two graphs. Used in SVMs for graph classification.
Read article →Graph Neural Networks
Aggregate neighbor features. Layer-wise propagation. Standard GNN framework.
Read article →Group Knapsack
Items partitioned into groups. Pick at most 1 from each. Common in course scheduling.
Read article →Half-Plane Intersection
Intersect N half-planes → convex polygon. O(N log N) via duality.
Read article →Hamiltonian Path
Backtracking + bitmask DP for small N.
Read article →HITS Algorithm
Kleinberg's dual model: hubs point to authorities, authorities pointed to by hubs.
Read article →HMAC
Key + hash → MAC. Prevents length extension attacks. Standard authentication.
Read article →HNSW
Multi-layer graph. Sub-log ANN queries. Powers Pinecone, Qdrant.
Read article →Homomorphic Encryption
Add/multiply encrypted values without decrypting. Cloud privacy compute.
Read article →Hopcroft-Karp
Find multiple augmenting paths per phase. Best bipartite matching bound.
Read article →Huffman Coding
Combine two least-frequent nodes repeatedly. Builds optimal variable-length code.
Read article →Hungarian Algorithm
Weighted bipartite matching in O(V³). Classical optimization.
Read article →Influence Maximization
Pick K seed nodes to maximize spread in social network. NP-hard, 63% approx.
Read article →Integer Partitions
P(n) = number of ways to write n as sum of positive integers. Euler's pentagonal recurrence.
Read article →Interval Graphs
Graph class with polynomial-time coloring, max clique, indep set.
Read article →Interval Merging + Meeting Rooms
Two classic interval problems solved by sorting + linear scan.
Read article →Interval Tree
Augmented BST enabling all-overlaps-with query in O(log N + K).
Read article →ISAP
Practical max-flow: BFS heights + gap heuristic. Often fastest.
Read article →Iterative Deepening DFS
DFS with increasing depth limit. Space O(d), finds shortest first.
Read article →Iterative DFS
Manual stack for large graphs. Same result as recursive.
Read article →Job Scheduling with Deadlines
Maximize profit scheduling jobs with deadlines + single machine.
Read article →Johnson's Algorithm
Bellman-Ford + reweighting + Dijkstra × V. Beats Floyd-Warshall on sparse graphs.
Read article →Karger's Min Cut
Repeatedly contract random edges. With prob ≥ 2/n², preserves min cut.
Read article →Karp's Minimum Mean Cycle Algorithm
Find cycle with minimum mean edge weight. O(VE).
Read article →K-d Tree
Partition K-dimensional space alternating axis at each level.
Read article →k-d Tree
Recursive space partition. NN in O(log N) expected on low dimensions.
Read article →Electrical Networks + Graph Theory
Effective resistance = graph theoretic quantity. Powers many algorithms.
Read article →k-means Clustering
Assign points to nearest centroid, recompute centroids, repeat. O(N·k·d·iterations).
Read article →KMP Algorithm
Knuth-Morris-Pratt. Failure function avoids rechecking. Linear-time substring search.
Read article →k-Nearest Neighbors (kNN)
Predict from majority of k nearest training points. Simple non-parametric.
Read article →Kosaraju's Algorithm
DFS on graph + DFS on reverse graph. Two passes yield strongly connected components.
Read article →Kruskal's Minimum Spanning Tree
Sort edges + Union-Find gives MST in O(E log E).
Read article →Kth Smallest in BST
In-order traversal with early termination.
Read article →Kuhn's Algorithm
Simplest maximum bipartite matching. O(V·E). Interviews standard.
Read article →Label Propagation
Each node adopts label most common among neighbors. O(V+E) per iteration.
Read article →Fast Laplacian Solvers
Solve L x = b in Õ(m log n) time. Foundation of modern graph algorithms.
Read article →LCP Array
Longest common prefix between consecutive suffixes in sorted order. O(N) given SA.
Read article →Legendre + Jacobi Symbols
Generalized quadratic-residue predicates. Enable primality tests + reciprocity.
Read article →LFU Cache
Evict item with lowest access count. Complex O(1) implementation.
Read article →Line Segment Intersection
Find all K intersections of N segments in O((N+K) log N) via sweep line.
Read article →Linear Diophantine Equations
Solve ax + by = c in integers. Extended Euclidean gives all solutions.
Read article →Linear Regression
Predict y from X via linear model. Closed form + regularization variants.
Read article →Link-Cut Tree
Sleator-Tarjan structure supporting link, cut, and path queries on dynamic forest.
Read article →Singly Linked List
Insert, delete, search — with animation and time bounds.
Read article →LSH
Hash similar items to same bucket. High-dim NN in sublinear time.
Read article →Logistic Regression
Sigmoid + cross-entropy. Linear model for classification. Interpretable coefficients.
Read article →Longest Common Subsequence
Longest sequence appearing in both strings (not necessarily contiguous). O(N·M).
Read article →Longest Common Substring
Longest contiguous common substring. O(N+M) via SA of concatenation.
Read article →Longest Palindromic Subsequence
Longest subsequence (not contiguous) that's a palindrome. O(N²) DP.
Read article →Longest Path in DAG
Longest path is NP-hard in general graphs but polynomial in DAG. Topological DP.
Read article →Longest Repeated Substring
Longest substring appearing ≥ 2 times. Max LCP in suffix array.
Read article →Louvain Algorithm
Greedy + hierarchical merging. Standard for large-scale community detection.
Read article →Lowest Common Ancestor (LCA)
Recursive, binary lifting, and Euler tour + RMQ approaches.
Read article →LRU Cache
O(1) get + put + eviction with the classic combined data structure.
Read article →Lucas' Theorem
C(n, k) mod p via digit-by-digit multiplication in base p.
Read article →Manacher's Algorithm
Longest palindromic substring in O(N). Beats O(N²) DP.
Read article →Matrix Exponentiation
Compute Fibonacci-like recurrence terms in O(log N) via matrix power.
Read article →Matrix-Tree Theorem
Number of spanning trees = any cofactor of Laplacian matrix.
Read article →Max Flow
Augmenting paths + residual graph give max flow through network.
Read article →Maximum Flow
Push flow from source to sink until no augmenting path. Foundation of flow algorithms.
Read article →Max-Flow Min-Cut Theorem
Max flow = min cut. Powerful duality with applications everywhere.
Read article →Max Flow via Electrical Flows
Modern max flow using electrical network + Laplacian solvers.
Read article →Maximum Independent Set
Find largest vertex set with no edges. NP-hard, but practical algorithms exist.
Read article →Min-Cost Flow via Cost Scaling
Polynomial in log(max cost). Best theoretical bound.
Read article →Merge K Sorted Lists
PriorityQueue over K heads. Total O(N log K).
Read article →Merge Sort Tree
Segment tree where each node stores sorted merge of its range.
Read article →Merge Two Sorted Lists
Merge sorted linked lists in-place, O(N+M).
Read article →Miller-Rabin
Test if n is prime via Fermat-like tests. Fast + accurate.
Read article →Min-Cost Bipartite Matching
Sub-cubic algorithms via cost scaling + push-relabel.
Read article →Min-Cost Max Flow
Max flow with minimum cost. Each edge has capacity + cost.
Read article →Layered Graph Techniques
Split graph into K layers. Enables constraint tracking via edges between layers.
Read article →Mo's Algorithm
Sort queries + linear pointer movement. O((N + Q) × sqrt(N)) total.
Read article →Dirichlet Convolution + Multiplicative Functions
Convolution of number-theoretic functions. Möbius function inverts.
Read article →Modular Exponentiation
Compute aⁿ mod m in O(log n) via binary exponentiation.
Read article →Modularity
Q measures how much better than random the community structure is.
Read article →Monte Carlo Tree Search (MCTS)
Random simulations + tree expansion. Behind AlphaGo + modern game AI.
Read article →Morris Traversal
Threading trick lets us traverse without stack or recursion.
Read article →Motion Planning
Sample-based path planning in configuration space. Robotics workhorse.
Read article →Multi-Party Computation (MPC)
N parties compute f(x1,...,xN) without revealing inputs. Foundation of privacy-preserving compute.
Read article →Multi-Commodity Flow
K different commodities share capacity. LP-based, NP-hard variants.
Read article →Multi-Source BFS
Initialize BFS with all sources at distance 0. Compute distance to nearest source.
Read article →Multi-Dimensional Knapsack
Add weight + volume + budget → multi-dim DP.
Read article →Naive Bayes
Assume feature independence given class. Fast + surprisingly competitive.
Read article →Network Reliability
Given edge failure probabilities, probability s connected to t. #P-hard exact.
Read article →Backpropagation
Compute gradients w.r.t. all weights in O(1) forward + backward passes.
Read article →node2vec
Biased random walks + skip-gram. Learn continuous node representations.
Read article →Number of Islands
Count connected land regions. Variants: max area, distinct shapes, sinking.
Read article →OAuth 2.0 + OpenID Connect
Delegated authorization + authentication. Powers 'Sign in with Google/Apple'.
Read article →Odd Cycle Transversal
Min vertex set whose removal makes graph bipartite. NP-hard, FPT algorithms.
Read article →Offline Dynamic Connectivity
Answer connectivity queries with edge additions AND deletions in offline setting.
Read article →Robust Orientation Predicate
Cross product with adaptive precision. Prevents floating-point bugs.
Read article →PageRank
Random surfer model. Eigenvector of link matrix. Power iteration.
Read article →Eertree
Data structure containing all distinct palindromes. O(N) build.
Read article →Password Hashing
Slow, memory-hard functions defeat GPU/ASIC attackers.
Read article →Key Derivation Functions
Derive cryptographic keys from passwords or other keys. Standard building blocks.
Read article →Path Sum Problems Family
Root-to-leaf, any path, path count with sum — all one recursion pattern.
Read article →PCA
Find directions of max variance. Linear dim reduction + decorrelation.
Read article →Percolation Theory
Fluid through porous media = random subgraph connectivity. Critical thresholds.
Read article →Perfect Graphs
Chromatic = clique number for every induced subgraph. Polynomial coloring.
Read article →Perfect Squares
Lagrange's four-square theorem: always ≤ 4. DP finds exact minimum.
Read article →Permutations + Combinations Backtracking
Generate all permutations/combinations/subsets systematically.
Read article →Persistent Segment Tree
Create versioned segment trees sharing unchanged nodes. Query any historical state.
Read article →Piece Table
Original buffer + insertion buffer + list of pieces = fast text editing without huge copies.
Read article →Planar Max Flow
In planar graphs, max flow reduces to shortest path in dual graph.
Read article →Planarity Testing
Determine if graph can be drawn without edge crossings. O(V+E).
Read article →Point in Polygon
Cast horizontal ray, count intersections. Odd → inside.
Read article →Point-to-Line + Point-to-Segment Distance
Fundamental primitives. Cross product for line, project + clamp for segment.
Read article →Populate Next Right Pointers in Binary Tree
Connect all nodes at same level using O(1) extra space.
Read article →Post-Quantum Hash-Based Signatures
Signatures from hash functions alone. Slower but conservative security assumption.
Read article →Post-Quantum Crypto
Learning With Errors problem. NIST PQC winners. Coming to TLS + SSH.
Read article →Post-Quantum Migration Strategy
Hybrid mode, crypto-agility, roadmap. Real deployment guidance for 2025-2030.
Read article →Prim's MST
Priority queue-based MST alternative to Kruskal's.
Read article →Prime Counting Function π(x)
Number of primes ≤ x. Meissel-Mertens O(x^(2/3)) computation.
Read article →Prime Factorization
Randomized factorization in O(N^(1/4)) expected. Finds small factors fast.
Read article →Primitive Roots + Discrete Log
Generator of ℤ*/p. Discrete log is one-way function of crypto.
Read article →Priority Queue via Binary Heap
Array-based heap with sift-up + sift-down. Foundation of Dijkstra, Prim, event schedulers.
Read article →Prüfer Sequence
Encode any labeled tree on n vertices as (n-2)-tuple. Foundation of tree counting.
Read article →Push-Relabel Max Flow
Excess flow + height labels. O(V²·√E) FIFO variant. Very fast in practice.
Read article →Quadratic Residues + Tonelli-Shanks
√a mod p. Legendre symbol for existence. Tonelli-Shanks for computation.
Read article →Quadtree + Octree
Divide 2D into 4 quadrants (quadtree) or 3D into 8 octants (octree) recursively.
Read article →R-Tree
Group nearby objects into minimum bounding rectangles hierarchically.
Read article →Rabin-Karp
Rolling hash slides through text. O(N+M) expected, O(NM) worst.
Read article →Rabin-Karp
Hash the pattern once + slide a rolling window over text. Great for multi-pattern.
Read article →Radix (Patricia) Tree
Trie with single-child chains compressed. Space-efficient IP routing.
Read article →Random Forest
N trees on bootstrap samples + random feature subsets. Robust, no-tuning ensemble.
Read article →Erdős-Rényi Random Graphs
G(n, p): each edge exists independently with probability p. Phase transitions.
Read article →Random Spanning Tree
Uniformly random spanning tree via loop-erased random walks.
Read article →Random Walks
Foundation of many graph algorithms. Cover time, mixing time, hitting time bounds.
Read article →Range Tree
Nested BSTs enable O(log^d N + K) range queries in d dimensions.
Read article →Red-Black Tree
The five properties that keep the tree logarithmically balanced.
Read article →Regex Engines
NFA construction + simulation → linear time. Backtracking → catastrophic.
Read article →Q-Learning
Learn action-value function Q(s, a) via Bellman updates. Foundation of DQN.
Read article →Reservoir Sampling
Sample k items uniformly from a stream of unknown length using only O(k) memory.
Read article →Reverse-Delete MST
Sort edges descending, delete each if graph stays connected.
Read article →Reverse a Linked List
Three-pointer iterative reverse in O(N) with O(1) extra space.
Read article →RNN, LSTM, GRU
Recurrent networks. LSTM/GRU solve vanishing gradient. Legacy but foundational.
Read article →Rod Cutting
Cut rod of length N to maximize revenue from price table. Same as unbounded knapsack.
Read article →Rope
Balanced binary tree of string fragments enables O(log N) insert/delete on huge strings.
Read article →Rotating Calipers
Sweep antipodal points around convex hull. O(N) after hull.
Read article →OSPF Routing
Link-state protocol runs Dijkstra on router LSDB. Foundation of IP routing.
Read article →RSA
Encrypt/sign via modular exponentiation. Security relies on factoring hardness.
Read article →Scale-Free Networks
Power-law degree distribution. Preferential attachment generates them.
Read article →Second-Best MST
Find MST → try replacing each MST edge with cheapest non-tree edge closing cycle.
Read article →Shamir's Secret Sharing
Threshold sharing: any t of n shares reconstruct secret. Information-theoretic security.
Read article →Segment Tree Beats
Handle 'set to min(a[i], x)' style range ops in near-O(log² N).
Read article →Segment Tree for Geometry
Range queries on intervals + rectangles via segment tree extensions.
Read article →Segment Tree
Build in O(N), query + update ranges in O(log N). Foundation of range-based DS.
Read article →SHA Family
Cryptographic hash functions. SHA-1 broken. SHA-2 dominant. SHA-3 different design.
Read article →Grid Shortest Path Variants
Grid problems with diagonals, diverse costs, teleports.
Read article →Detecting Negative Cycles
V-th round improvement → negative cycle. Then trace it.
Read article →Shortest Path with Waypoints
Visit set of intermediate points. TSP-adjacent.
Read article →SSSP with Negative Edges
Bellman-Ford, SPFA, Goldberg's algo. Different trade-offs.
Read article →Side-Channel Attacks
Extract secrets from physical/timing behavior. Constant-time crypto defends.
Read article →Sieve of Eratosthenes
Classical prime sieve. O(N log log N).
Read article →Skip List
Multi-level linked list with random height. O(log N) with simple code.
Read article →Small-to-Large Merging
Always merge smaller into larger. Achieves O(N log² N) total for problems like distinct colors in subtree.
Read article →Small-World Networks
Short average path + high clustering. Models social + biological networks.
Read article →Smallest Enclosing Circle
Randomized O(N) expected. Minimum-radius circle containing all points.
Read article →Sort Linked List
Split, sort halves, merge. Only algorithm that beats O(N²) on linked lists.
Read article →Spectral Clustering
Use eigenvectors of graph Laplacian → k-means in eigenspace.
Read article →SPFA
Queue-based Bellman-Ford. Often 4x faster in practice, same worst case.
Read article →Splay Tree
Every access moves the node to the root. Amortized O(log N) with no explicit balance data.
Read article →Steiner Tree
MST connects ALL vertices. Steiner connects TERMINALS — can add auxiliary Steiner nodes.
Read article →Stern-Brocot Tree
Binary tree containing every positive rational in lowest terms exactly once.
Read article →Stoer-Wagner
O(V³) or O(VE + V² log V). No source-sink pair needed.
Read article →String Hashing
H(s) = s[0]·b^(n-1) + s[1]·b^(n-2) + ... mod p. O(1) substring hash after O(N) preprocessing.
Read article →Wildcard Matching via FFT
Pattern with '?' wildcards. FFT enables O((N+M) log(N+M)) match.
Read article →Strong Bridges + Strong Articulation Points
Directed analogs: edges/vertices whose removal disconnects the SCC structure.
Read article →Subset Sum Backtracking
For huge sums or non-integer values, backtracking with pruning beats DP.
Read article →Subset Sum
Does a subset with given sum exist? Count of such subsets? Both O(N × S).
Read article →Succinct Data Structures
Store trees/graphs in space close to information-theoretic minimum + constant-time queries.
Read article →Sudoku Solver
Fill 9×9 grid. Try digits, backtrack on constraint violation.
Read article →Suffix Array
Sort all suffixes. Enables substring queries. Building block of many string algos.
Read article →Suffix Arrays
Sorted array of all suffixes. Powers substring search + longest common substring.
Read article →Substring Search via Suffix Array Binary Search
Binary search sorted suffixes for pattern. O(M log N) matching.
Read article →Suffix Automaton
Smallest DFA recognizing all substrings of a string. O(N) construction.
Read article →Suffix Automaton
State machine accepting exactly substrings of S. O(N) construction.
Read article →DAWG
Minimized trie. Compresses shared suffixes. Compact dictionary storage.
Read article →Suffix Tree
Every suffix as a path from root. O(N) construction via Ukkonen's algorithm.
Read article →Suffix Tree
Trie of all suffixes, compressed. Ukkonen: build in O(N) online.
Read article →Sum of Root-to-Leaf Numbers
Each root-to-leaf path forms a number. Sum all such numbers.
Read article →Suurballe's Algorithm
Find two paths that don't share edges. Total cost minimized.
Read article →Support Vector Machines + Kernel Trick
Maximum-margin classifier. Kernel enables nonlinear via implicit high-dim mapping.
Read article →Symmetric Tree Check
Is a binary tree a mirror of itself?
Read article →t-SNE
Preserve local neighborhoods. Great for cluster visualization, misleading globally.
Read article →Target Sum
Assign +/- to each number to reach target. Reduces to subset sum.
Read article →Tarjan's SCC
Elegant O(V+E) algorithm using low-link values.
Read article →Temporal Graphs
Edges appear/disappear over time. Reachability, shortest paths richer.
Read article →Thorup's Algorithm
For undirected integer weights, achieves linear time via hierarchical structure.
Read article →TLS 1.3 Handshake
1-RTT handshake. ECDHE + certificate + AEAD. Modern secure channel.
Read article →Topological Sort
Linear ordering respecting DAG edges. Two classic algorithms.
Read article →Topological Sort
Two elegant ways to order a DAG. Basis of build systems, course scheduling.
Read article →Transformer
Encoder-decoder with self-attention. 2017 paper reshaped ML.
Read article →Traveling Salesman Problem
Bitmask DP: O(2^N × N²) beats brute-force O(N!).
Read article →Treap
BST on keys + heap on random priorities. Balance emerges from randomness.
Read article →Tree Diameter
Compute the diameter using height recursion.
Read article →Tree Isomorphism Check
Are two trees the same shape? Recursive with children permutation.
Read article →Tree Views
Four view problems solved with BFS + coordinate tracking.
Read article →Treewidth
Measures how 'tree-like' a graph is. Bounded treewidth → many NP-hard problems become linear.
Read article →Trie
Character-by-character tree. O(|W|) insert/search. Foundation of autocomplete + IP routing.
Read article →Trie (Prefix Tree)
Word storage with O(L) insert/lookup + prefix operations.
Read article →2-SAT via SCC
Convert clauses to implication graph, find SCCs, check consistency.
Read article →Union-Find with Rollback
Support undo. Union by rank only (no path compression). O(log N) per op.
Read article →Union-Find Variants
Union-Find (DSU) with path compression + union by rank gives near-O(1) amortized.
Read article →van Emde Boas Tree
Recursive structure achieving O(log log U) where U = universe size.
Read article →Vertex Cover
Any maximal matching yields 2-approx. Best-known unless P=NP.
Read article →Vertex Cover in Bipartite
Min vertex cover = max matching in bipartite graphs. Elegant duality.
Read article →Voronoi Diagram
Plane partitioned into cells, each containing points closest to a site.
Read article →Wavelet Tree
Recursive bit-vector partitioning enables rank/select/kth in O(log Σ).
Read article →Word2Vec
Learn word vectors from context prediction. 2013 breakthrough.
Read article →Word Search
Find word in 2D grid by adjacency. Classic DFS + backtracking.
Read article →Yen's Algorithm
Find not just shortest but K distinct shortest paths. Deviation-based.
Read article →Z-Algorithm
Z[i] = longest substring starting at i that matches a prefix. O(N).
Read article →Zero-Knowledge Proofs
Prove knowledge of secret without leaking it. Foundation of ZK-rollups + privacy tech.
Read article →