All 388 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 →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 →Biconnected Components
Maximal subgraphs where removing any single vertex leaves connected. DFS + low-link.
Read article →Bidirectional BFS
Search from both source and target. Meet halfway → 2x speedup at least.
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 →Borůvka's Algorithm
Each component picks its cheapest outgoing edge in parallel. Halves components per round.
Read article →Boundary Traversal of Binary Tree
Left boundary → leaves → right boundary (reversed).
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 →Edit Distance (Levenshtein)
Insert, delete, replace: three transitions in a 2D 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 →Longest Increasing Subsequence (LIS)
O(N²) DP + O(N log N) patience sort.
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 →Expectation-Maximization
Iterative MLE with hidden variables. Foundation of GMM, HMM, LDA training.
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 Convolutional Networks (GCN)
Simplified GNN: normalized adjacency × features × weights.
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 →Greedy Graph Coloring
Order vertices by degree, color each with lowest available. Simple + fast.
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 →Heavy-Light Decomposition
Break tree into chains so any root-to-node path crosses O(log N) chains.
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 →JWT
Signed JSON claim bundles. Ubiquitous for API auth. Common security pitfalls.
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 →Kerberos
Symmetric-key auth for enterprise networks. Foundation of Active Directory.
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 →KMP Pattern Matching
Preprocess the pattern to avoid rescanning the text. O(N + M).
Read article →Unbounded Knapsack
Each item may be taken any number of times. O(N × W).
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 →Levenshtein Automaton
NFA/DFA accepting words within edit distance k. Fast fuzzy search.
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 →Minimum Cost Arborescence
Rooted directed tree of minimum total cost. Chu-Liu-Edmonds again.
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 →Möbius Function + Inversion
μ(n) enables inversion of multiplicative sums. Foundation of number theory identities.
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 →Minimum Bottleneck Spanning Tree
MST minimizes total weight; MBST minimizes maximum edge. MST solves both.
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 →N-Queens Problem
Place N queens on N×N board so none attack. Explore + prune.
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 →Order Statistic Tree
Augmented balanced BST supporting kth element + rank queries.
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 →Policy Gradient
Directly optimize policy via gradient of expected reward. Foundation of modern RL.
Read article →Polygon Triangulation
Simple polygon → triangles. Ear clipping O(N²), sweep-line O(N log N).
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 →Geometric Sweep + Fenwick
Sort events, sweep, Fenwick tree for 1D counts. O(N log N).
Read article →Segment Tree for Geometry
Range queries on intervals + rectangles via segment tree extensions.
Read article →Segment Tree with Lazy Propagation
Range updates + range queries in O(log N) with deferred pushes.
Read article →Segment Tree
Build in O(N), query + update ranges in O(log N). Foundation of range-based DS.
Read article →Serialize + Deserialize Binary Tree
Convert tree to string and back. Pre-order with null markers.
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 →Shortest Path in DAG
DAG has no cycles → topological order → linear relaxation. Even with negatives.
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 Path Compression + Union by Rank
Nearly O(1) per operation with two simple optimizations.
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 →