Skip to main content

Glossary

The main terms of the course, in alphabetical order. Each entry gives a short definition and links to the lesson where the term is explained in detail.

A*. Best-first search that orders states by f=g+hf = g + h: the cost already paid plus an optimistic estimate of the cost still to pay. With an admissible hh it finds an optimal solution. See Branch and Bound.

Adaptive sorting algorithm. A sorting algorithm that runs faster when the input is already partly sorted, such as insertion sort. See Insertion Sort.

Admissible heuristic. An estimate of the remaining cost that never exceeds the true remaining cost. See Branch and Bound: Classic Problems.

Algorithm. A finite sequence of precise, unambiguous instructions that solves a problem for every valid input in a finite time. See Algorithmic Thinking.

Amdahl's law. The maximum speedup of a program with a sequential fraction ss is 1/s1 / s, however many processors are used. See Performance of Parallel Algorithms.

Asymptotic notation. The notations OO, Ω\Omega and Θ\Theta, which describe how a function grows for large inputs, ignoring constant factors. See Asymptotic Notation.

Average case. The expected cost of an algorithm over all inputs of a given size, under some probability distribution. See Complexity Analysis.

Backtracking. A depth-first search over an implicit tree of partial solutions that abandons a partial solution as soon as it cannot be completed. See Backtracking.

Best case. The input of a given size for which an algorithm does the least work. See Complexity Analysis.

Big O. f(n)∈O(g(n))f(n) \in O(g(n)) means that, from some size on, ff grows no faster than a constant multiple of gg: an upper bound. See Asymptotic Notation.

Binary search. Search in a sorted array that compares with the middle element and discards half of the array at each step, in O(log⁡n)O(\log n). See Searching Case Studies.

Bound. In branch and bound, an optimistic estimate of the best solution reachable from a node, used to prune nodes that cannot beat the best solution known. See Branch and Bound.

Branch and bound. A search over an implicit tree that keeps the live nodes in a (usually priority) queue, expands the most promising one, and prunes with bounds. See Branch and Bound.

Branching factor. The number of children of a node in a tree of states (also called its degree). See Backtracking.

Brute force. Solving a problem in the most direct way, following its statement, without exploiting its structure. See Brute Force and Exhaustive Search.

Combinatorial explosion. The very fast (exponential or factorial) growth of the number of candidate solutions as the input grows. See Backtracking.

Complexity (time and space). The amount of time, or memory, an algorithm needs as a function of the size of its input. See Complexity Analysis.

Concurrency. Several tasks making progress in overlapping periods of time, not necessarily at the same instant. See Concurrency and Parallelism.

Divide and conquer. Solving a problem by splitting it into smaller subproblems of the same kind, solving them (usually recursively) and combining their solutions. See Divide and Conquer.

Division (recurrence by). A recursive scheme in which each call works on a fraction n/bn / b of the input; its cost is O(nk)O(n^k), O(nklog⁡n)O(n^k \log n) or O(nlog⁡ba)O(n^{\log_b a}) depending on aa, bb and kk. See Analyzing Divide and Conquer.

Dynamic programming. Solving a problem by solving each distinct subproblem only once and storing its result in a table, when subproblems overlap and the principle of optimality holds. See Dynamic Programming.

Efficiency. In parallel computing, the speedup divided by the number of processors: how well the processors are used. See Performance of Parallel Algorithms.

Exhaustive search. Generating every candidate in the space of possible solutions and testing each one. See Brute Force and Exhaustive Search.

Fork/Join. The Java framework for parallel divide and conquer: a task splits (forks) into subtasks, which run in parallel, and waits for (joins) their results. See The Fork/Join Framework.

Geometric series. A sum 1+r+r2+⋯+rk1 + r + r^2 + \dots + r^k; it is dominated by its last term if r>1r \gt 1 and by its first if r<1r \lt 1, the key to analyzing divide and conquer. See Sums, Logarithms and Factorials.

Greedy algorithm. An algorithm that builds a solution step by step, always taking the choice that looks best at the moment and never reconsidering it. See Greedy Algorithms.

Harmonic number. Hn=1+1/2+⋯+1/n≈ln⁡n+0.577H_n = 1 + 1/2 + \dots + 1/n \approx \ln n + 0.577. It appears in the average case of randomized algorithms such as Quicksort. See Sums, Logarithms and Factorials.

Heuristic. A rule of thumb that usually leads to good decisions but does not guarantee them. In search, an estimate of how promising a state is. See Greedy Algorithms and Branch and Bound.

Implicit graph. A graph of states that is never stored: its nodes are generated only when the search reaches them. See Backtracking.

Induction. A proof technique: prove a property for a base case, and prove that if it holds for smaller values it holds for the next one. It is how recursive algorithms are proved correct. See Induction, Correctness and Recurrences.

In-place algorithm. An algorithm that needs only a constant (or very small) amount of memory besides its input. See The Sorting Problem.

Live node. In branch and bound, a node that has been generated but not yet expanded. See Branch and Bound.

Loop invariant. A property that holds before a loop and after every iteration, used to prove the loop correct. See Induction, Correctness and Recurrences.

Memoization. The top-down form of dynamic programming: a recursive algorithm that stores each result the first time it is computed and reuses it afterwards. See Dynamic Programming.

Omega and Theta. Ω(g(n))\Omega(g(n)) is a lower bound on growth; Θ(g(n))\Theta(g(n)) means both O(g(n))O(g(n)) and Ω(g(n))\Omega(g(n)), an exact order of growth. See Asymptotic Notation.

Parallelism. Several computations executing at the same instant on different processors or cores. See Concurrency and Parallelism.

Partition. In Quicksort, rearranging an array so that the elements smaller than a pivot come before it and the larger ones after it. See Quicksort.

Pivot. The element around which Quicksort partitions the array. See Quicksort.

Principle of optimality. The property that an optimal solution is made of optimal solutions to its subproblems; it is required to apply dynamic programming to an optimization problem. See Dynamic Programming.

Pruning. Discarding a branch of a search tree without exploring it, because it is proven not to contain a valid or better solution. See Backtracking.

Pseudo-polynomial time. A running time that is polynomial in the numeric value of the input (such as the capacity WW in the 0/1 knapsack, O(nW)O(nW)) but exponential in the number of bits needed to write it. See Dynamic Programming: Classic Problems.

Recurrence. An equation that defines the cost of a recursive algorithm in terms of its cost on smaller inputs. See Analyzing Divide and Conquer.

Sentinel. A special value placed at the end of an array so that a loop does not need to check the bounds. See Searching Case Studies.

Sequential threshold. In parallel divide and conquer, the problem size below which a task is solved sequentially instead of being split further. See The Fork/Join Framework.

Speedup. The time of the sequential version divided by the time of the parallel version. See Performance of Parallel Algorithms.

Stable sorting algorithm. A sorting algorithm that keeps the relative order of elements with equal keys. See The Sorting Problem.

Stirling's formula. The approximation n!≈2πn(n/e)nn! \approx \sqrt{2\pi n}(n/e)^n, which shows that n!n! grows faster than any exponential and that log⁡(n!)∈Θ(nlog⁡n)\log (n!) \in \Theta(n \log n). See Sums, Logarithms and Factorials.

Stress testing. Comparing a fast algorithm with a simple, trusted one (often brute force) on many random small inputs to find bugs. See Brute Force and Exhaustive Search.

Subtraction (recurrence by). A recursive scheme in which each call works on an input of size n−bn - b; with one call the cost is polynomial, with several calls it is exponential. See Analyzing Divide and Conquer.

Tree of states. The conceptual tree explored by backtracking and branch and bound: the root is the initial state, each level is a decision, and the leaves are solutions or dead ends. See Backtracking.

Worst case. The input of a given size for which an algorithm does the most work. See Complexity Analysis.

Questions, or something wrong?

Errors, suggestions and public questions open a form on GitHub, visible to everyone.