Reference library
Foundations
Explore concepts, laws, equations and methods, with clear explanations of their use and sources. Choose an area of study or find a specific entry.
More filters
Algorithms & data structures
Showing 1–30 of 30 reference entries
Graphs represent pairwise connections; trees impose acyclicity.
DefinitionInformationData-structure interfaces and operation costsAn interface defines operations; an implementation determines costs.
MethodInformationLoop invariants and total correctnessAn invariant establishes correctness only with its proof obligations.
MethodInformationComparison sorting lower boundDistinct-key comparisons need enough branches to distinguish orders.
Mathematical statementInformationBreadth-first and depth-first traversalGraph searches visit reachable vertices using different orders.
MethodInformationShortest-path algorithm conditionsEdge weights determine which shortest-path method applies.
MethodInformationTuring machines and effective computationFinite instructions can act on an unbounded writable tape.
DefinitionInformationRelations and tabular dataA relation is a set of tuples from declared domains.
DefinitionInformationHash tables with chainingA hash table maps keys to buckets and stores colliding keys in a chain.
MethodInformationAVL search trees and rotationsAn AVL binary search tree maintains subtree heights differing by at most one at every node.
MethodInformationBinary heaps and priority queuesA binary max heap stores a complete binary tree in an array with every parent key at least its children's keys.
MethodInformationHeapsortBuild a max heap, exchange its root with the last active element, shrink the active heap and restore heap order; repeat.
MethodInformationDynamic programming and subproblem reuseDynamic programming states subproblems and recurrences, checks an acyclic dependency order and base cases, and evaluates each needed subproblem once by memoization or bottom-up order.
MethodInformationSubset-sum dynamic programming and input lengthFor positive integers a₁,…,aₙ and target T≥0, D(i,t)=D(i−1,t) or [t≥aᵢ and D(i−1,t−aᵢ)], with D(0,0)=true and other initial states false.
MethodInformationBellman–Ford and negative cyclesInitialize d(s)=0 and other distances to infinity, then relax every directed edge for |V|−1 rounds.
MethodInformationBinary search and its invariantOn a sorted random-access array, compare the target with the middle key and discard the half that cannot contain it; repeat until a matching key is found or the remaining interval is empty.
MethodInformationMerge sort and divide-and-conquer recurrenceSplit an array into two nearly equal halves, sort each recursively, and merge sorted halves by repeatedly choosing the next ordered key.
MethodInformationGreedy interval scheduling and exchange proofTo maximize the number of compatible intervals, repeatedly take the available interval finishing earliest and discard overlapping intervals.
MethodInformationMinimum-spanning-tree cut propertyIn a connected undirected weighted graph, if a set of chosen edges lies within some minimum spanning tree and a cut crosses none of them, a lightest edge crossing that cut can be added while preserving this invariant.
Mathematical statementInformationKruskal minimum spanning treeProcess edges in nondecreasing weight order, adding an edge exactly when its endpoints belong to different current components, then merge those components.
MethodInformationDynamic-array doublingAppend to an array with spare capacity; when full, allocate twice the capacity and copy existing entries.
MethodInformationFlow feasibility and max-flow/min-cut certificateA directed network flow respects nonnegative capacities and conserves flow at vertices other than source s and sink t.
Mathematical statementInformationEdmonds–Karp augmenting-path algorithmStarting with zero flow, find a shortest residual s–t path by breadth-first search and augment by its minimum residual capacity, updating forward and reverse capacities.
MethodInformationDiscrete Fourier transform and inverseFor N complex coefficients aⱼ define yₖ=Σ_(j=0)^(N−1)aⱼωᴶᴷ, with ω=e²πⁱ⁄ᴺ.
Mathematical statementInformationRadix-two fast Fourier transformFor N a power of two, split polynomial coefficients into even and odd indices, recursively transform each half, and combine values using p(z)=p_even(z²)+zp_odd(z²).
MethodInformationStable integer counting sortFor n records with integer keys 0≤k<U, append records to U insertion-ordered buckets by key, then concatenate buckets in increasing key order.
MethodInformationLeast-significant-digit radix sortRepresent nonnegative integer keys with d base-B digits and stably sort each digit from least to most significant.
MethodInformationTopological order and directed cycle detectionA finite directed graph admits an order placing u before v for every edge u→v exactly when it is acyclic.
MethodInformationShortest paths by DAG relaxationIn a finite integer-weighted DAG set d(s)=0 and other d(v)=∞, process vertices in topological order, and relax each outgoing u→v by d(v)←min(d(v),d(u)+w(u,v)).
MethodInformationLongest common subsequence by dynamic programmingFor string suffixes A[i:],B[j:], let L(i,j) be their longest common subsequence length.
Method