Skip to content

Glossary: Programming and Algorithms

Every term Programming and Algorithms defines, from A to Z, with the section that teaches it. A section that uses a term from elsewhere, in this book or another, also lists it under “Concepts from other sections” at the top of the page.

432 terms

  • 0/1 knapsack: choosing a subset of items, each used at most once, to maximize total value within a capacity; with a single row of storage the capacity loop runs backwards so each item is counted at most once. Taught in Chapter 9: Dynamic programming
  • Abstract Equality: the coercing algorithm behind ==, as opposed to the non-converting ===. Taught in 17.4 Predicting TypeScript output
  • Accept interfaces, return structs: the Go guideline to take parameters as small interfaces, so callers can pass anything that fits, and to return concrete types, so methods can be added later without breaking callers. Taught in Chapter 20: Go
  • Ad-hoc polymorphism: a different implementation per type, chosen by the types involved (overloading, typeclasses, traits, interfaces). Taught in 2.4 Generics at runtime and language comparison
  • Adjacency list: a per-vertex list of outgoing edges; O(V + E) space for the whole graph. Taught in 18.6 Graph as an adjacency list
  • Adjacency matrix: a V×VV \times V table whose entry (u,v)(u, v) records whether, or with what weight, an edge joins uu and vv; it gives O(1)O(1) edge lookup at O(V2)O(V^2) space, which suits dense graphs. Taught in Chapter 8: Graphs
  • Affinity routing: sending requests with the same prefix to the same engine so its prefix cache stays warm. Taught in 15.9 A consistent hash ring with bounded loads
  • aggregate: a function such as COUNT, SUM, or MAX that turns the rows of a group into one value. Taught in 1.11 SQL and SQLite: schema, transactions, WAL mode, indexes, aggregates
  • Algebraic data type (ADT): a type built from sums (“one of these variants”) and products (“all of these fields”), such as a Rust enum with payloads; with exhaustive matching, every case must be handled explicitly. Taught in Chapter 21: Rust
  • alignment: the power of two that an object’s address must be a multiple of. Taught in 1.3 C: memory, pointers, structs, headers, and the C11 toolchain
  • Alignment: the requirement that an object’s address be a multiple of some power of two. Taught in 18.8 Arena allocator
  • Allocator equality: two allocators compare equal when memory from one can be freed through the other. Taught in 19.9 Memory pool allocator
  • Amortised cost: the average cost per operation over a worst-case sequence of operations, here O(1) per push even though one push in many is O(n). Taught in 18.1 Dynamic array
  • Amortized cost: the total cost of a sequence of operations divided by their number. Taught in 15.1 A growable array
  • amortized O(1): constant average cost per operation over a long sequence, as with geometric growth. Taught in 1.3 C: memory, pointers, structs, headers, and the C11 toolchain
  • Arc share: the fraction of the ring a node owns, and so the expected fraction of keys it receives. Taught in 15.9 A consistent hash ring with bounded loads
  • Arena: a Vec that owns every node, with nodes linked by index. Taught in 15.7 A radix tree over token ids
  • Arena (bump) allocator: an allocator that serves requests by advancing an offset and frees all allocations at once. Taught in 18.8 Arena allocator
  • AVL tree: a self-balancing binary search tree that keeps the heights of every node’s two subtrees within one of each other by rotating after insertions, which guarantees O(log⁡n)O(\log n) height and operations. Taught in Chapter 7: Trees
  • Back edge: an edge found during depth-first search that points to a node still in progress on the current path; in a directed graph, tracked with three node states (unvisited, in progress, visited), a back edge is exactly a cycle. Taught in Chapter 8: Graphs
  • backpressure: a slow consumer slowing its producer, so memory between them stays bounded. Taught in 1.9 Async Rust and tokio: futures, tasks, channels, cancellation, hyper
  • Backpressure: slowing the producer when the consumer cannot keep up, here by blocking submit on a full queue. Taught in 18.7 Thread pool
  • Backtracking: depth-first search over a tree of partial solutions that makes a choice, recurses, and undoes the choice, abandoning any branch that cannot lead to a valid solution; it enumerates subsets, permutations, and solutions to constraint problems. Taught in Chapter 11: Backtracking
  • Backward-shift deletion: moving the following run back one slot after a removal, instead of leaving a tombstone. Taught in 15.5 A Robin Hood hash map
  • Balance factor: the height of a node’s left subtree minus the height of its right subtree; an AVL tree keeps it in {−1,0,1}\{-1, 0, 1\}, and its sign pattern after an insertion decides between a single and a double rotation. Taught in Chapter 7: Trees
  • Base case: an input on which a recursive function returns directly without calling itself; together with an input that strictly shrinks on every call, it guarantees that the recursion terminates. Taught in Chapter 13: Recursion and divide-and-conquer
  • Binary exponentiation / fast exponentiation: computing xnx^n by squaring x⌊n/2⌋x^{\lfloor n/2 \rfloor} and multiplying by xx once more when nn is odd, in O(log⁡n)O(\log n) multiplications; the same idea gives matrix and modular exponentiation. Taught in Chapter 13: Recursion and divide-and-conquer
  • Binary heap: a complete binary tree in an array in which no child comes out before its parent. Taught in 15.6 A binary heap with lazy deletion
  • Binary search: a search that keeps an interval known to contain the answer and halves it with one comparison per step, taking O(log⁡n)O(\log n) steps; it needs a monotonic predicate, not necessarily a sorted array. Taught in Chapter 5: Binary search
  • Binary search on the answer: binary searching over the range of possible answers with a monotone feasibility check, which turns an optimization problem (“the smallest capacity that works”) into O(log⁡n)O(\log n) decision problems (“does this capacity work?”). Taught in Chapter 5: Binary search
  • Binary search tree (BST): a binary tree in which every node’s value is greater than every value in its left subtree and less than every value in its right subtree, so a search follows one root-to-leaf path and an in-order traversal yields the values in sorted order. Taught in Chapter 7: Trees
  • Bit mask: an integer whose set bits select positions, such as 1 << i for bit i; OR with it sets the bit, AND with its complement clears it, XOR toggles it, and AND tests it. Taught in Chapter 12: Math and bit manipulation
  • Bitmask DP: dynamic programming whose state includes a subset of up to about 20 items encoded as the bits of an integer, giving 2n2^n states; used for the Travelling Salesman Problem and subset partitioning. Taught in Chapter 9: Dynamic programming
  • Block expression: a block whose value is its final expression when that expression has no trailing semicolon. Taught in 17.3 Predicting Rust output
  • Block table: the per-sequence list of KV block ids, one per 16 tokens. Taught in 15.1 A growable array
  • Blocking queue: a queue whose operations wait, rather than fail, when it is full or empty. Taught in 19.4 Thread-safe queue
  • Bloom filter: an mm-bit array with kk hash probes per item, answering membership with no false negatives. Taught in 15.8 A Bloom filter
  • borrow: use of a value through a shared (&) or exclusive (&mut) reference without taking ownership. Taught in 1.4 Rust: ownership, traits, Result, cargo workspaces, std TCP
  • Borrow checker: the part of the Rust compiler that enforces ownership and borrowing: any number of shared references (&T) or exactly one mutable reference (&mut T), and no reference outliving the value it points at; it rejects use-after-free and data races at compile time. Taught in Chapter 21: Rust
  • Bottom-up DFS: a tree recursion that solves both subtrees first and then combines their results with the node’s own value (post-order); it fits problems where a node’s answer depends on its children’s answers, such as height, diameter, and balance. Taught in Chapter 7: Trees
  • Bottom-up DP / tabulation: filling a table of subproblem answers in an order where each entry’s dependencies are already computed, with no recursion; the iterative way to implement dynamic programming. Taught in Chapter 9: Dynamic programming
  • bounded channel: a channel with a fixed capacity whose send waits while it is full. Taught in 1.9 Async Rust and tokio: futures, tasks, channels, cancellation, hyper
  • Bounded loads: a cap of ⌈c(m+1)/n⌉\lceil c(m+1)/n \rceil per node, with over-cap keys walking clockwise to the next node below it. Taught in 15.9 A consistent hash ring with bounded loads
  • Bounded quantification: parametric polymorphism restricted to types below a bound, as in T: Ord. Taught in 2.4 Generics at runtime and language comparison
  • Branching factor: the number of choices at each node of a search tree; a backtracking search costs roughly the branching factor raised to the depth, such as 2n2^n for subsets and n!n! for permutations. Taught in Chapter 11: Backtracking
  • Branded type: a primitive type intersected with a phantom marker, such as number & { __brand: 'USD' }, so values with the same representation but different meanings are not interchangeable; nominal typing inside a structural type system. Taught in Chapter 23: TypeScript
  • Breadth-first search (BFS): traversal in order of hop distance using a FIFO queue. Taught in 18.6 Graph as an adjacency list
  • broadcasting: numpy’s rule for treating differently shaped operands as one shape by stretching size-1 axes with stride 0. Taught in 1.1 Python and numpy: arrays, dtypes, broadcasting, views vs copies, uv projects
  • BUD analysis: justifying an optimization by naming the bottleneck, the unnecessary work, and the duplicated work. Taught in Chapter 27: Case Study: Order Book Matching
  • buffer: the flat block of memory that holds an array’s elements. Taught in 1.1 Python and numpy: arrays, dtypes, broadcasting, views vs copies, uv projects
  • Dangling pointer: a pointer to memory that has been freed or moved, which is undefined behaviour to dereference. Taught in 18.1 Dynamic array
  • Dangling reference: a reference to an object whose lifetime has ended. Taught in 19.5 Expression templates
  • deadline: a fixed point in time after which work is cancelled, unlike an idle timeout that restarts on activity. Taught in 1.6 Go: packages, interfaces, goroutines, channels, context, net/http, testing
  • decay: the conversion of an array’s name to a pointer to its first element. Taught in 1.3 C: memory, pointers, structs, headers, and the C11 toolchain
  • Default value evaluation: default expressions are evaluated once, when def runs, and stored in __defaults__. Taught in 17.2 Predicting Python output
  • Deferred call: a function call scheduled with Go’s defer to run when the surrounding function returns; deferred calls run in last-in, first-out order, which makes them the place for cleanup. Taught in Chapter 20: Go
  • Deleter: the callable a smart pointer uses to destroy what it owns. Taught in 19.2 UniquePtr
  • Deployment: an object declaring a Pod template, a replica count, and an update strategy, implemented through ReplicaSets. Taught in 1.7 Containers and Kubernetes: images, layers, Pods, Deployments, Services, Helm, kind
  • Depth-first search (DFS): traversal that follows one path as far as possible before backtracking, using a stack. Taught in 18.6 Graph as an adjacency list
  • Detection idiom: a trait built with std::void_t and partial specialisation that reports whether an expression is well formed. Taught in 19.3 Compile-time matrix
  • digest: the SHA-256 hash that names a layer or image immutably; a tag, by contrast, is a movable pointer. Taught in 1.7 Containers and Kubernetes: images, layers, Pods, Deployments, Services, Helm, kind
  • Dijkstra’s algorithm: single-source shortest paths for non-negative edge weights that repeatedly pops the closest unsettled node from a priority queue, relaxes its edges, and skips popped entries whose distance is stale; O((V+E)log⁡V)O((V + E) \log V) with a binary heap. Taught in Chapter 8: Graphs
  • Discriminated union: a union of object types that share a literal tag field such as kind, so checking the tag narrows the value to one member; with never, the compiler can verify that a switch handles every case. Taught in Chapter 23: TypeScript
  • Displacement: how many slots past its home an entry sits. Taught in 15.5 A Robin Hood hash map
  • Divide and conquer / divide-and-conquer: an algorithm design that splits a problem into independent subproblems, solves them recursively, and combines their results; unlike dynamic programming the subproblems do not overlap, and the gain comes from better asymptotics, as in merge sort. Taught in Chapter 13: Recursion and divide-and-conquer
  • Double hashing: generating probes gi=h1+i h2g_i = h_1 + i\,h_2 from two hashes. Taught in 15.8 A Bloom filter
  • DP state: the parameters that identify one subproblem in dynamic programming, such as an index, a pair of prefixes, or a remaining capacity; choosing it well is the main difficulty of a DP problem. Taught in Chapter 9: Dynamic programming
  • DP transition: the recurrence that expresses a DP state’s answer in terms of smaller states, such as dp[i] = max(dp[i-1], dp[i-2] + nums[i]); together with the base cases it defines the whole computation. Taught in Chapter 9: Dynamic programming
  • Drop: running a value’s destructor when its owner goes out of scope; locals drop in reverse declaration order. Taught in 17.3 Predicting Rust output
  • Dummy head node: a placeholder node placed before a linked list’s real head so that every real node has a predecessor; insertions, deletions, and merges then need no special case for the head, and the result is dummy.next. Taught in Chapter 6: Linked lists
  • Dunder method: a method named with double underscores, such as __iter__ or __eq__, that Python calls to carry out an operator, attribute lookup, iteration, or with block; defining them makes your types behave like built-ins. Taught in Chapter 22: Python
  • Dynamic programming (DP): solving a problem by breaking it into overlapping subproblems and storing each subproblem’s answer the first time it is computed, which turns an exponential recursion into a polynomial computation. Taught in Chapter 9: Dynamic programming
  • Edit distance: the minimum number of insertions, deletions, and substitutions that turn one string into another, computed by a two-sequence DP over pairs of prefixes in O(mn)O(mn). Taught in Chapter 9: Dynamic programming
  • errdefer: a Zig statement that schedules cleanup to run only if the enclosing scope exits with an error, which undoes a partial construction without touching the success path. Taught in Chapter 24: Zig
  • Error return trace: a record, kept by the Zig runtime, of where an error was created and every frame it was returned through, so a failure can be traced without exceptions or stack unwinding. Taught in Chapter 24: Zig
  • Error union: a Zig type E!T that holds either an error from the set E or a value of type T; try propagates the error and catch handles it. Taught in Chapter 24: Zig
  • Errors as values: reporting failure by returning an ordinary error value alongside the result, as Go’s error interface does, instead of throwing an exception; every failure path is then an explicit check such as if err != nil. Taught in Chapter 20: Go
  • Escape analysis: a compiler pass that keeps a value on the stack unless a reference to it can outlive the function, in which case the value is moved to the heap; Go and the JVM use it to reduce garbage-collector work. Taught in Chapter 20: Go
  • event loop: the single-threaded scheduler that runs ready coroutines and wakes them when their sockets or timers are ready. Taught in 1.8 Python asyncio: event loop, tasks, cancellation, bounded concurrency
  • Exchange argument: a proof that a greedy algorithm is optimal, made by taking any optimal solution that differs from the greedy one, swapping in the greedy choice, and showing the result is no worse. Taught in Chapter 10: Greedy algorithms
  • executor: the part of the runtime that polls ready tasks on a pool of worker threads. Taught in 1.9 Async Rust and tokio: futures, tasks, channels, cancellation, hyper
  • Exhaustive pattern matching: a match that the compiler checks covers every variant of a type, so adding a variant turns each place that does not handle it into a compile error. Taught in Chapter 21: Rust
  • exit status: the integer from 0 to 255 a process reports when it ends; 0 means success. Taught in 1.2 Shell, git, make, processes: exit codes, signals, environment, pipes
  • Explicit allocator: the Zig convention that every function that allocates takes an allocator as a parameter, so memory cost is visible at the call site and the strategy (arena, pool, leak-detecting test allocator) can change without changing the code. Taught in Chapter 24: Zig
  • exponential backoff: waiting b⋅2n−1b \cdot 2^{n-1} after failed attempt nn before trying again. Taught in 1.8 Python asyncio: event loop, tasks, cancellation, bounded concurrency
  • Expression template: a type that represents an unevaluated expression, evaluated later in one pass. Taught in 19.5 Expression templates
  • Failure atomicity: the property that a failed operation leaves the structure exactly as it was. Taught in 15.1 A growable array
  • False positive: a non-member whose kk probes all land on bits set by other items. Taught in 15.8 A Bloom filter
  • Fast and slow pointers: two pointers that move through a sequence at different speeds, usually one and two steps; the slow one is at the midpoint when the fast one reaches the end, and the two meet if the sequence contains a cycle. Taught in Chapter 4: Two pointers and sliding window
  • Fenwick tree / binary indexed tree (BIT): an array-based structure for prefix sums with O(log⁡n)O(\log n) point updates and prefix queries, smaller and simpler than a segment tree. Taught in Chapter 16: Competitive Programming
  • field number: the integer that identifies a field on the wire; it must never change or be reused. Taught in 1.10 Protocol Buffers and gRPC: schema evolution, unary and streaming RPCs, stubs
  • Find-or-insert: the operation that returns an existing entry for a key or creates one. Taught in 18.9 String interning
  • Fingerprint (H2H_2): the low 7 bits of the mixed hash, used to reject slots without reading their keys. Taught in 15.2 A Swiss table
  • Fixed-size sliding window: a window of exactly kk consecutive elements moved one step at a time, updating a running aggregate by adding the element that enters and removing the one that leaves, so all windows together cost O(n)O(n). Taught in Chapter 4: Two pointers and sliding window
  • Flexible array member: a trailing data[] array in a struct, letting header and variable-size storage share one allocation. Taught in 18.8 Arena allocator
  • Flood fill: a DFS or BFS from one cell that marks every cell reachable through matching neighbors; starting one from each unvisited cell counts connected regions, such as the islands in a grid. Taught in Chapter 8: Graphs
  • Floyd’s construction (heapify): building a heap in O(n)O(n) by sifting down every parent, last first. Taught in 15.6 A binary heap with lazy deletion
  • Floyd’s cycle detection / tortoise and hare: detecting a cycle in a linked list by advancing one pointer one step and another two steps until they meet, then finding the cycle’s start by restarting one pointer at the head and advancing both one step at a time until they meet again. Taught in Chapter 6: Linked lists
  • FNV-1a: a byte-at-a-time hash that XORs each byte in and then multiplies by a prime. Taught in 15.8 A Bloom filter
  • For-comprehension: Scala syntax that desugars a sequence of generators into nested flatMap calls and a final map, giving sequential-looking code for Option, Future, and other monads. Taught in Chapter 25: Scala
  • Frequency counting: building a map from each value to the number of times it occurs in one pass, then answering questions about duplicates, anagrams, or the most common elements from that map. Taught in Chapter 3: Arrays and hashing
  • Full expression: the outermost expression of a statement; temporaries live until it ends. Taught in 19.5 Expression templates
  • Full slice expression: a[low:high:max], which also sets the capacity of the resulting slice. Taught in 17.1 Predicting Go output
  • future: a value implementing Future, which does nothing until polled and then returns Ready or Pending. Taught in 1.9 Async Rust and tokio: futures, tasks, channels, cancellation, hyper
  • Fx hash: a fast rotate-xor-multiply hash whose strong bits are the high ones. Taught in 15.5 A Robin Hood hash map
  • Generation counter: a per-slot counter, copied into handles, that makes old handles mismatch after the slot is reused. Taught in 15.6 A binary heap with lazy deletion
  • Generator: a paused function frame that runs to the next yield on each next and is exhausted once its body finishes. Taught in 17.2 Predicting Python output
  • Geometric growth: multiplying the capacity by a constant factor g≥2g \ge 2 when full, which makes appends O(1)O(1) amortized. Taught in 15.1 A growable array
  • Geometric growth: growing capacity by a constant factor, which makes the total copying cost linear in the number of pushes. Taught in 18.1 Dynamic array
  • Given instance: a Scala 3 value declared with given that the compiler supplies automatically wherever a parameter of its type is required; it replaces implicits for type-class instances and derivation. Taught in Chapter 25: Scala
  • Global interpreter lock (GIL): CPython’s lock that lets only one thread execute Python bytecode at a time, so threads speed up I/O-bound work but not CPU-bound work; an experimental free-threaded build from 3.13 removes it. Taught in Chapter 22: Python
  • goroutine: a function running concurrently, scheduled by the Go runtime. Taught in 1.6 Go: packages, interfaces, goroutines, channels, context, net/http, testing
  • Goto-cleanup pattern: a C idiom in which every failure path jumps with goto to labels at the end of the function that release resources in reverse order of acquisition, so each resource is freed exactly once on every exit path. Taught in Chapter 18: C
  • graceful shutdown: stop accepting, let in-flight work finish within a bound, then exit 0. Taught in 1.9 Async Rust and tokio: futures, tasks, channels, cancellation, hyper
  • Gradual typing: a type system in which static type annotations are optional and unannotated code stays dynamically typed; Python’s interpreter ignores annotations, and checkers such as mypy and pyright enforce them. Taught in Chapter 22: Python
  • Granule (gg): the run length in tokens at which labels are compared and split; one KV block. Taught in 15.7 A radix tree over token ids
  • Greedy algorithm: an algorithm that commits at each step to the choice that looks best now and never reconsiders it; it is correct only when the problem has the greedy-choice property. Taught in Chapter 10: Greedy algorithms
  • Greedy-choice property: the property that some optimal solution begins with the locally best choice, so committing to that choice never rules out an optimum; it is what separates greedy problems from dynamic programming ones. Taught in Chapter 10: Greedy algorithms
  • half-open window: a time range [since, until) that includes its start and excludes its end. Taught in 1.11 SQL and SQLite: schema, transactions, WAL mode, indexes, aggregates
  • Handle: the stable pointer (const Interned *) the table returns for a string. Taught in 18.9 String interning
  • Hash flooding: a denial-of-service attack that sends keys chosen to collide, turning O(1) operations into O(n). Taught in 18.2 Hash map with open addressing
  • header: a case-insensitive name, a colon, and a value in an HTTP message head. Taught in 1.5 HTTP/1.1, JSON, and Server-Sent Events from the wire up
  • Heap property: in a min-heap, every parent’s priority is less than or equal to its children’s. Taught in 18.4 Binary heap
  • Heap sort: repeatedly moving the root to the end of a shrinking heap to sort in place. Taught in 15.4 Heap top-k in C
  • Heapify (Floyd’s method): building a heap in O(n) by sifting down every internal node from the bottom up. Taught in 18.4 Binary heap
  • Helm chart: a directory of templated Kubernetes YAML plus default values; installing it creates a release. Taught in 1.7 Containers and Kubernetes: images, layers, Pods, Deployments, Services, Helm, kind
  • Higher-kinded type: a type parameterized by a type constructor rather than a type, such as F[_], which lets one piece of code abstract over containers like List, Option, and Future. Taught in Chapter 25: Scala
  • Hole: an array index with no property at all, distinct from a property holding undefined. Taught in 17.4 Predicting TypeScript output
  • Home group: the group of 16 slots where a key’s probe starts, chosen by H1 mod GH_1 \bmod G. Taught in 15.2 A Swiss table
  • Huffman code table: the dictionary from each character to its bit string, read off the Huffman tree; the decoder needs it, or the tree, to turn the bit stream back into text. Taught in 10.1 Huffman coding
  • Huffman coding: an optimal prefix code built greedily by repeatedly merging the two least frequent symbols or subtrees with a min-heap, so the rarest symbols get the longest codewords; it takes O(klog⁡k)O(k \log k) for kk symbols. Taught in Chapter 10: Greedy algorithms
  • Huffman tree: the binary tree Huffman’s algorithm builds, with each character at a leaf; a character’s code is its path from the root, 0 for a left branch and 1 for a right one, so frequent characters sit near the root and get short codes. Taught in 10.1 Huffman coding
  • HyperLogLog (HLL): a cardinality estimator that hashes each element and records the most leading zeros seen in each of many buckets, then combines the buckets with a harmonic mean; it counts billions of distinct items to within about 2% in about 1.5 KB. Taught in Chapter 14: Probabilistic data structures
  • Idempotent free: a release function that is safe to call twice because it returns the object to its initial empty state. Taught in 18.1 Dynamic array
  • Identity: whether two names refer to the same object, tested with is. Taught in 17.2 Predicting Python output
  • IEEE 754 double: the 64-bit floating-point format of every JavaScript number, exact for integers up to 2^53. Taught in 17.4 Predicting TypeScript output
  • image: a stack of content-addressed filesystem layers plus a config that says how to start the process. Taught in 1.7 Containers and Kubernetes: images, layers, Pods, Deployments, Services, Helm, kind
  • Implicit graph: a graph whose nodes and edges are computed on demand rather than stored, such as grid cells and their four neighbors or words that differ by one letter; it needs no extra space for edges. Taught in Chapter 8: Graphs
  • In-degree: the number of edges entering a vertex, counting parallel edges separately. Taught in 18.6 Graph as an adjacency list
  • In-order traversal: visiting a binary tree’s left subtree, then the node, then the right subtree; on a binary search tree it produces the values in sorted order. Taught in Chapter 7: Trees
  • In-place list reversal: reversing a linked list in one pass with O(1)O(1) extra space by pointing each node’s next back at its predecessor, saving the original next first so the rest of the list is not lost. Taught in Chapter 6: Linked lists
  • Incremental parser: a parser that accepts input in arbitrary chunks and resumes where the previous chunk ended. Taught in 18.10 HTTP request parser
  • index: a sorted B-tree copy of chosen columns that lets a query search instead of scan. Taught in 1.11 SQL and SQLite: schema, transactions, WAL mode, indexes, aggregates
  • Index marking: using an array’s own indices as a hash table when its values lie in [1,n][1, n], for example by negating the entry at index v−1v - 1 to record that vv was seen; it gives O(n)O(n) time with O(1)O(1) extra space. Taught in Chapter 3: Arrays and hashing
  • Input iterator: a single-pass iterator whose copies do not independently preserve position. Taught in 19.6 Coroutine generator
  • Input range: a range that can be traversed once, front to back. Taught in 19.8 Graph with concepts
  • interface: a method set that any type with those methods satisfies implicitly. Taught in 1.6 Go: packages, interfaces, goroutines, channels, context, net/http, testing
  • Interface value: a pair of dynamic type and dynamic value, nil only when both halves are nil. Taught in 17.1 Predicting Go output
  • Interval DP: dynamic programming over contiguous ranges [i,j][i, j] that tries every split point and fills the table in order of increasing interval length, typically in O(n3)O(n^3); used for matrix-chain multiplication and Burst Balloons. Taught in Chapter 9: Dynamic programming
  • Interval scheduling: selecting the most non-overlapping intervals, solved greedily by sorting on end time and taking each interval that starts no earlier than the last chosen one ends. Taught in Chapter 10: Greedy algorithms
  • Intrusive free list: a list of free blocks whose links are stored inside the free blocks themselves. Taught in 19.9 Memory pool allocator
  • Intrusive list: a linked list whose link fields live inside the elements, so linking needs no allocation. Taught in 15.3 An intrusive list and an LRU
  • Intrusive list: a list whose link fields are embedded in the elements themselves rather than in separately allocated nodes. Taught in 18.3 Intrusive linked list
  • Inversion count: the number of pairs i<ji < j with ai>aja_i > a_j, computed in O(nlog⁡n)O(n \log n) during merge sort’s merge by adding the number of remaining left-half elements each time a right-half element is taken first. Taught in Chapter 13: Recursion and divide-and-conquer
  • Involution: a function that is its own inverse, such as x↦−x−1x \mapsto -x-1 on int. Taught in 18.4 Binary heap
  • Java record: a class declared as record Point(int x, int y), an immutable data carrier for which the compiler generates the constructor, accessors, equals, and hashCode. Taught in Chapter 26: Java
  • k-sum reduction: solving 3Sum, 4Sum, and their relatives by sorting, fixing k−2k - 2 elements in nested loops, and running a two-pointer sweep on the rest while skipping repeated values; it brings 3Sum from O(n3)O(n^3) to O(n2)O(n^2). Taught in Chapter 4: Two pointers and sliding window
  • k-way merge: merging kk sorted lists by keeping their current heads in a min-heap of size kk and repeatedly taking the smallest, in O(Nlog⁡k)O(N \log k) time for NN elements in total. Taught in Chapter 6: Linked lists
  • Kadane’s algorithm: the O(n)O(n) maximum-subarray algorithm that tracks the best sum of a subarray ending at the current position, either extending the previous one or starting fresh, along with the best sum seen overall. Taught in Chapter 9: Dynamic programming
  • Kahn’s algorithm: topological sort by repeatedly emitting vertices whose in-degree has dropped to zero. Taught in 18.6 Graph as an adjacency list
  • Kernighan’s algorithm: counting the set bits (the popcount) of an integer by repeatedly clearing the lowest one with n &= n - 1, in time proportional to the number of set bits. Taught in Chapter 12: Math and bit manipulation
  • kind: a tool that runs each Kubernetes node as a Docker container. Taught in 1.7 Containers and Kubernetes: images, layers, Pods, Deployments, Services, Helm, kind
  • Knuth-Morris-Pratt algorithm (KMP): string matching in O(n+m)O(n + m) that uses a failure function over the pattern to know, after a mismatch, how far the pattern can shift without re-reading text. Taught in Chapter 16: Competitive Programming
  • Ladder: a preallocated array indexed by price tick, with a pointer to the best level. Taught in Chapter 27: Case Study: Order Book Matching
  • Lazy adapter: an iterator method such as map that builds a wrapper and does no work until a consumer calls next. Taught in 17.3 Predicting Rust output
  • Lazy deletion: marking an item dead and discarding it only when it reaches the root. Taught in 15.6 A binary heap with lazy deletion
  • Lazy deletion: leaving outdated entries in a priority queue and discarding them when popped. Taught in 19.8 Graph with concepts
  • Lazy deletion: leaving stale entries in a heap and discarding them when they reach the top. Taught in Chapter 27: Case Study: Order Book Matching
  • Lazy evaluation: deferring computation until its result is needed. Taught in 19.5 Expression templates
  • Lazy propagation: deferring range updates in a segment tree by storing pending changes at internal nodes and pushing them to the children only when a later operation descends through, which makes range updates O(log⁡n)O(\log n). Taught in Chapter 16: Competitive Programming
  • Left-boundary binary search: the binary search over a half-open interval [left, right) that returns the first index where a condition holds, or the length if it never does, by never discarding a mid that satisfies the condition. Taught in Chapter 5: Binary search
  • Level-order traversal: visiting a tree level by level with a queue, reading the queue’s length at the start of each round to know how many nodes belong to the current level; it is breadth-first search on a tree. Taught in Chapter 7: Trees
  • Linear probing: on a collision, trying the next slot, wrapping at the end. Taught in 15.5 A Robin Hood hash map
  • Linear probing: on collision, trying the next slot, then the next, wrapping at the end. Taught in 18.2 Hash map with open addressing
  • linkage: whether a name is visible outside its translation unit (external) or only inside it (internal, static). Taught in 1.3 C: memory, pointers, structs, headers, and the C11 toolchain
  • Load factor: the fraction of slots that are not empty; here it counts tombstones as well as live entries. Taught in 18.2 Hash map with open addressing
  • Load factor (α\alpha): entries divided by slots; here kept at or below 7/8. Taught in 15.5 A Robin Hood hash map
  • Lock count: the number of locks pinning a node, counting locks on its descendants. Taught in 15.7 A radix tree over token ids
  • Lost wake-up: a notification that arrives between a waiter’s predicate check and its sleep, and is therefore missed. Taught in 19.4 Thread-safe queue
  • lower_bound / upper_bound: binary searches for the first position not less than, or the first position greater than, a key. Taught in 18.5 Merge sort, buffered and in place
  • Lowest common ancestor (LCA): the deepest node that has both of two given nodes as descendants, counting a node as its own descendant; found by searching both subtrees in a general binary tree, or by following the values left or right in a BST. Taught in Chapter 7: Trees
  • Lowest set bit: the least significant 1 bit of an integer; x & -x isolates it and x & (x - 1) clears it, both because negation in two’s complement flips every bit above it. Taught in Chapter 12: Math and bit manipulation
  • LRU (least recently used): an eviction policy that reclaims the element whose last use is oldest. Taught in 15.3 An intrusive list and an LRU
  • Quickselect: expected-linear selection of the kk-th element by partitioning, which reorders its input. Taught in 15.4 Heap top-k in C
  • Same-size rebuild: a rehash that drops tombstones without growing, because the live keys still fit. Taught in 15.2 A Swiss table
  • Saturating and wrapping arithmetic: explicit methods that clamp to the type’s bounds or wrap modulo its width. Taught in 17.3 Predicting Rust output
  • Sealed class / sealed interface: a Java class or interface that lists the only types allowed to extend it, so a pattern-matching switch over it can be checked for exhaustiveness; with records, Java’s way to write algebraic data types. Taught in Chapter 26: Java
  • Sealed trait: a Scala trait whose subtypes must all be defined in the same file, so the compiler knows every case and checks pattern matches for exhaustiveness; with case classes it encodes algebraic data types. Taught in Chapter 25: Scala
  • Segment tree: a binary tree over array ranges in which each node stores an aggregate, such as the sum or minimum, of its range; it supports point updates and range queries in O(log⁡n)O(\log n) after an O(n)O(n) build. Taught in Chapter 16: Competitive Programming
  • semaphore: a counter of permits that bounds how many coroutines are inside a section at once. Taught in 1.8 Python asyncio: event loop, tasks, cancellation, bounded concurrency
  • semaphore permit: a value representing one slot; holding it holds the slot, dropping it frees it. Taught in 1.9 Async Rust and tokio: futures, tasks, channels, cancellation, hyper
  • Send and Sync: Rust’s marker traits for thread safety: a Send type may be moved to another thread and a Sync type may be shared between threads by reference, so the compiler rejects code that could race. Taught in Chapter 21: Rust
  • Sentinel: a permanent dummy node in a circular list that makes every real node have real neighbours. Taught in 15.3 An intrusive list and an LRU
  • Sentinel: a dummy node that is never an element, used so that every real node always has neighbours. Taught in 18.3 Intrusive linked list
  • Server-Sent Events: a text/event-stream response whose body is data: lines grouped into events by blank lines. Taught in 1.5 HTTP/1.1, JSON, and Server-Sent Events from the wire up
  • Service: a stable name and virtual IP for the ready Pods whose labels match its selector. Taught in 1.7 Containers and Kubernetes: images, layers, Pods, Deployments, Services, Helm, kind
  • Shadowing: introducing a new binding with an existing name, hiding the old one until the scope ends. Taught in 17.3 Predicting Rust output
  • Shallow copy: a new outer container holding the same element references. Taught in 17.2 Predicting Python output
  • Sift up / sift down: repairs of the heap property after appending at the end or replacing the root. Taught in 15.4 Heap top-k in C
  • Sift up / sift down: the swaps that restore the heap property after a push at a leaf or a replacement at the root. Taught in 15.6 A binary heap with lazy deletion
  • Sift up / sift down: the repairs that move one element toward the root or the leaves until the heap property holds again. Taught in 18.4 Binary heap
  • signal: an asynchronous message from the kernel to a process, such as SIGTERM or SIGKILL. Taught in 1.2 Shell, git, make, processes: exit codes, signals, environment, pipes
  • Skip list: a sorted multi-level linked list in which each element is promoted to the next level up with probability 1/21/2; a search moves right, then drops down a level, giving expected O(log⁡n)O(\log n) search, insertion, and deletion without rebalancing. Taught in Chapter 14: Probabilistic data structures
  • Slice header: the (pointer, length, capacity) triple that views a backing array. Taught in 17.1 Predicting Go output
  • Sliding window: a contiguous range of an array or string whose two ends move only forward, so each element enters and leaves once and the whole scan is O(n)O(n). Taught in Chapter 4: Two pointers and sliding window
  • Small buffer optimisation (SBO): storing small objects inside the owning object to avoid a heap allocation. Taught in 19.7 Function: type erasure with a small buffer
  • Smart pointer: a class that owns a heap object and frees it in its destructor, applying RAII to memory; std::unique_ptr has exactly one owner and std::shared_ptr counts shared owners. Taught in Chapter 19: C++
  • Soundness: the guarantee that well-typed programs do not get stuck, proved as progress plus preservation. Taught in 2.4 Generics at runtime and language comparison
  • Sparse table: precomputed answers for every range whose length is a power of two, built in O(nlog⁡n)O(n \log n), that answer idempotent range queries such as range minimum in O(1)O(1) on a static array. Taught in Chapter 16: Competitive Programming
  • Splice: moving a whole run of nodes from one list to another by rewriting only the boundary pointers. Taught in 18.3 Intrusive linked list
  • Split: inserting a middle node so that a match ending inside an edge ends at a node. Taught in 15.7 A radix tree over token ids
  • SplitMix64 finalizer (mix64): a bijection on 64-bit words that mixes every input bit into every output bit. Taught in 15.8 A Bloom filter
  • Sprague-Grundy theorem: every impartial game is equivalent to a Nim heap whose size is the game’s Grundy value, so a sum of games is a win for the player to move exactly when the XOR of the Grundy values is nonzero. Taught in Chapter 16: Competitive Programming
  • Spurious wake-up: a return from a condition-variable wait with no corresponding signal, or after another thread consumed the change. Taught in 18.7 Thread pool
  • Stable heap: one that pops equal items in push order, here via a sequence number. Taught in 15.6 A binary heap with lazy deletion
  • Stable sort: a sort that keeps equal elements in their input order; heapsort is not one. Taught in 18.4 Binary heap
  • Stable sort: a sort that keeps elements with equal keys in their input order. Taught in 18.5 Merge sort, buffered and in place
  • stale lock: a lock file left by a process that died without cleaning up. Taught in 1.2 Shell, git, make, processes: exit codes, signals, environment, pipes
  • Stamp: the clock value of the last walk through a node, used to order the LRU list. Taught in 15.7 A radix tree over token ids
  • State-machine DP: dynamic programming that keeps one value per discrete state at each position, such as holding, just sold, or resting in stock-trading problems, and updates them together from the previous position’s values. Taught in Chapter 9: Dynamic programming
  • status code: the three-digit number in a response’s status line, whose first digit is its class. Taught in 1.5 HTTP/1.1, JSON, and Server-Sent Events from the wire up
  • status code: the gRPC result in the trailers, telling the caller what kind of failure happened. Taught in 1.10 Protocol Buffers and gRPC: schema evolution, unary and streaming RPCs, stubs
  • std::construct_at / std::destroy_at: start and end the lifetime of one object at a given address. Taught in 19.1 Vector
  • std::move_if_noexcept: yields an rvalue if the move constructor cannot throw (or the type is not copyable), and a const lvalue otherwise. Taught in 19.1 Vector
  • std::unique_lock: an RAII lock that can be unlocked early and is required by condition_variable::wait. Taught in 19.4 Thread-safe queue
  • Sticky error state: an error that, once entered, every later call reports, because the stream cannot be safely resynchronised. Taught in 18.10 HTTP request parser
  • stride: the number of bytes to move along an axis to reach the next index on it. Taught in 1.1 Python and numpy: arrays, dtypes, broadcasting, views vs copies, uv projects
  • String interning: keeping one canonical copy of each distinct string so equality becomes pointer comparison. Taught in 18.9 String interning
  • Strong exception guarantee: if an operation throws, the object is left exactly as it was before. Taught in 19.1 Vector
  • Structural typing: type compatibility decided by shape: a value fits a type when it has the required members, whatever it was declared as; TypeScript’s types and Go’s interfaces both work this way. Taught in Chapter 23: TypeScript
  • Structured concurrency: scoping a group of concurrent tasks to one block, so the block does not exit until all of them have finished and a failure in one cancels the rest. Taught in Chapter 26: Java
  • Subsumption: the rule that a concept defined in terms of another is more specific, used to order overloads. Taught in 19.8 Graph with concepts
  • Suffix array: the starting positions of a string’s suffixes in sorted order, built in O(nlog⁡n)O(n \log n); with its LCP (longest common prefix) array it answers substring queries. Taught in Chapter 16: Competitive Programming
  • surrogate pair: two \uXXXX escapes, a high and a low surrogate, that together spell a character above U+FFFF. Taught in 1.5 HTTP/1.1, JSON, and Server-Sent Events from the wire up
  • Suspend point: a place where the coroutine pauses; initial and final suspend are the two implicit ones. Taught in 19.6 Coroutine generator
  • SWAR: SIMD within a register; testing all bytes of a 64-bit word with a few integer operations. Taught in 15.2 A Swiss table
  • Symmetry breaking: fixing a choice, such as the first element or the first color, so a search does not explore solutions that are mirror images or relabelings of ones it has already found. Taught in Chapter 11: Backtracking
  • XOR trick: using a ^ a = 0, a ^ 0 = a, and the commutativity and associativity of XOR to cancel values that appear twice, so XOR-ing a whole collection leaves the one value that appears once. Taught in Chapter 12: Math and bit manipulation