EXACT-SUBSET-SUM, 1125
example, in clustering, 1006
exclusion and inclusion, 1158 ex.
execute a subroutine, 29 n.
expansion of a dynamic table, 461–465
expectation, see expected value
expected competitive ratio, 808
expected running time, 32, 129
of a binomial distribution, 1198
of a geometric distribution, 1197
of an indicator random variable, 130
explored edge, 565
exponential search tree, 226, 478
exponentiation
of logarithms, 66
exponentiation instruction, 27
EXTENDED-BOTTOM-UP-CUT-ROD, 372
EXTENDED-EUCLID, 914
EXTEND-SHORTEST-PATHS, 650
external node, 1172
external path length, 1175 ex.
extracting the maximum key
from d-ary heaps, 179 pr.
from max-heaps, 174
extracting the minimum key
from Young tableaus, 179 pr.
EXTRACT-MIN, 173
factor, 904
twiddle, 891
factorization, 956
unique, 909
failure, in a Bernoulli trial, 1196
fair coin, 1186
family of hash functions, 286–288, 292 ex.
fan-out, 1066
Farkas’s lemma, 869
fast Fourier transform (FFT), 877–902
multidimensional, 899 pr.
recursive implementation of, 888–891
using modular arithmetic, 901 pr.
feasibility problem, 627, 873 pr.
feasible linear program, 854
feasible region, 854
feasible vertex labeling, 724, 742 pr.
feature vector, 1006
Fermat’s theorem, 932
FFT, 890
see also fast Fourier transform
FFTW, 902
FIB, 751
Fibonacci heap, 478
in Dijkstra’s algorithm, 623–624
in Johnson’s algorithm, 666
in Prim’s algorithm, 597
Fibonacci numbers, 69, 70 ex., 121 pr.
computation of, 750–753, 954 pr.
FIFO, see first-in, first-out; queue
final-state function, 968
FIND-AUGMENTING-PATH, 738
FIND-DEPTH, 542 pr.
find path, 528
FIND-POM, 496 pr.
FIND-SET, 521
disjoint-set-forest implementation of, 530, 544
linked-list implementation of, 523
FIND-SPLIT-POINT, 778
finished vertex, 564
finish time
in activity selection, 418
in depth-first search, 565
and strongly connected components, 578
FINITE-AUTOMATON-MATCHER, 971
finite group, 917
finite sequence, 1162
finite set, 1156
finite sum, 1140
first-fit heuristic, 1131 pr.
first-in, first-out (FIFO), 254, 803–804, 814 ex.
implemented with a priority queue, 178 ex.
see also queue
fixed-length code, 432
floating-point data type, 26
floor function (⌊ ⌊), 63
floor instruction, 26
aggregate, 864
augmentation of, 678
blocking, 702
cancellation of, 679
integer-valued, 695
net, across a cut, 682
value of, 672
flow conservation, 672
corresponding to a bipartite graph, 694
with multiple sources and sinks, 674
FLOYD-WARSHALL, 657
FLOYD-WARSHALL′, 661 ex.
Floyd-Warshall algorithm, 655–659, 661–662 ex.
flying cars, highways for, 850
FORD-FULKERSON, 686
Ford-Fulkerson method, 676–693
FORD-FULKERSON-METHOD, 676
FORESEE, 797
breadth-first, 728
depth-first, 564
for, in pseudocode, 22
and loop invariants, 21 n.
fork-join parallelism, 749–770
see also parallel algorithm
fork-join scheduling, 759–761, 769 ex.
formal power series, 121 pr.
formula satisfiability, 1073–1076
forward edge, 569
Fourier transform, see discrete Fourier transform, fast Fourier transform
fractional knapsack problem, 429
fractional matching, 741 pr.
frequency count, 802 ex.
frequency domain, 877
full binary tree, 1174
relation to optimal code, 433
full node, 502
full rank, 1220
full walk of a tree, 1112
fully parenthesized matrix-chain product, 374
fully polynomial-time approximation scheme, 1105
Ackermann’s, 544
α-strongly convex, 1041
basis, 841
β-smooth, 1041
boolean, 1182 ex.
driving, 101
final-state, 968
hash, see hash function
potential, 456
probability distribution, 218 ex.
quadratic, 31
reduction, 1062
suffix, 968
watershed, 103
functional iteration, 68
fundamental theorem of linear programming, 872
furthest-in-future, 441
fuzzy sorting, 203 pr.
Gabow’s scaling algorithm for single-source shortest paths, 641 pr.
GALE-SHAPLEY, 719
Gale-Shapley algorithm, 718–722
Galois field of two elements ( GF(2)), 1224 pr.
gap character, 961 ex., 975 ex.
gate, 1065
Gaussian elimination, 825
gcd, see greatest common divisor
GCD recursion theorem, 911
general arithmetic series, 1141
general number-field sieve, 956
generating function, 121 pr.
generation of partitioned sets, 234
generator
of a subgroup, 922
of , 932
GENERIC-MST, 587
geometric distribution, 1196–1198
in finding prime numbers, 943
in randomized selection analysis, 232
geometric series, 1142
GF(2) (Galois field of two elements), 1224 pr.
global cut, 701 pr.
global minimizer, 1022, 1024 fig., 1026 fig.
global variable, 22
gossiping, 475
in machine learning, 1035–1037
for solving systems of linear equations, 1034–1035
stochastic, 1040 pr.
GRADIENT-DESCENT, 1025
GRADIENT-DESCENT-CONSTRAINED, 1032
gradient of a function, 1023
GRAFT, 542 pr.
grain size in a parallel algorithm, 783 pr.
adjacency-list representation of, 550–551
adjacency-matrix representation of, 551–552
and asymptotic notation, 548
breadth-first search of, 554–563
coloring of, 1100 pr.
complement of, 1085
component, 576
dense, 549
depth-first search of, 563–572
ϵ-dense, 668 pr.
hamiltonian, 1056
interval, 425 ex.
nonhamiltonian, 1056
planar, 584 pr.
shortest path in, 558
singly connected, 572 ex.
sparse, 549
static, 522
tour of, 1090
weighted, 551
see also directed acyclic graph, directed graph, flow network, undirected graph, tree GRAPH-ISOMORPHISM, 1060 ex.
Gray code, 471 pr.
greatest common divisor (gcd), 906–907, 910 ex.
binary gcd algorithm for, 953 pr.
Euclid’s algorithm for, 911–916, 954 pr.
with more than two arguments, 916 ex.
recursion theorem for, 911
GREEDY-ACTIVITY-SELECTOR, 424
GREEDY-BIPARTITE-MATCHING, 726
greedy-choice property, 427–428
of activity selection, 420–421
for activity selection, 418–425
for coin changing, 446 pr.
compared with dynamic programming, 384–385, 393 ex., 421, 426–430
for the fractional knapsack problem, 429
greedy-choice property in, 427–428
for maximal bipartite matching, 726
for minimum spanning tree, 591–599
optimal substructure in, 428
for task-parallel scheduling, 759–761, 769 ex.
for task scheduling, 446 pr.
for weighted set cover, 1132 pr.
greedy scheduler, 759
GREEDY-SET-COVER, 1117
grid, 697 pr.
cyclic, 932
operator (⊕), 917
growth step, 736
guessing the solution, in the substitution method, 92
Habanero-Java, 750
half 3-CNF satisfiability, 1099 ex.
half-open interval ([ a, b) or ( a, b]), 1157
Hall’s theorem, 715 ex.
halting, 6
halting problem, 1042
halving lemma, 887
HAM-CYCLE, 1056
hamiltonian graph, 1056
hamiltonian path, 1060 ex., 1098 ex.
HAM-PATH, 1060 ex.
handle, 173
handshaking lemma, 1168 ex.
HASH-DELETE, 300 ex.
auxiliary, 295
collision-resistant, 941
cryptographic, 291
division method for, 284, 292 ex.
for hierarchical memory, 304–307
multiplication method for, 284–286
multiply-shift method for, 285–286
see also family of hash functions
with chaining, 277–281, 308 pr.
independent uniform, 276
with linear probing, 297, 302–304
with open addressing, 293–301, 308 pr.
perfect, 310
to replace adjacency lists, 553 ex.
of static sets, 308 pr.
uniform, 278
of variable-length inputs, 290–291
dynamic, 470 ex.
used within a priority queue, 174
see also hashing
hash value, 275
hat-check problem, 134 ex.
head
in a disk drive, 498
of a linked list, 259
of a queue, 256
analyzed by potential method, 459 ex.
in constructing Huffman codes, 436
deletion from, 178 ex.
in Dijkstra’s algorithm, 623
extracting the maximum key from, 174
Fibonacci, 478
height of, 163
insertion into, 175
in Johnson’s algorithm, 666
max-heap, 162
maximum key of, 174
mergeable, 268 pr.
min-heap, 163
in Prim’s algorithm, 597
HEAP-DECREASE-KEY, 176 ex.
HEAP-EXTRACT-MIN, 176 ex.
HEAP-MINIMUM, 176 ex.
heap property, 162
vs. binary-search-tree property, 315 ex.
lower bound for, 207
HEAPSORT, 170
HEDGE, 1039 pr.
height
black-, 332
of a d-ary heap, 179 pr.
of a decision tree, 207
of a heap, 163
of a node in a heap, 163, 170 ex.
of a node in a tree, 1173
of a red-black tree, 332
of a tree, 1173
height-balanced tree, 357 pr.
helpful partitioning, 232
Hermitian matrix, 838 ex.
Hessian matrix, 1035
heuristic
first-fit for bin packing, 1131 pr.
path compression, 528
in the Rabin-Karp algorithm, 965
for the set-covering problem, 1116, 1132 pr.
table doubling, 461
for the traveling-salesperson problem, 1115 ex.
union by rank, 528
weighted union, 525
high endpoint of an interval, 489
high side of a partition, 183
HIRE-ASSISTANT, 127
hiring problem, 126–127, 135–136
probabilistic analysis of, 132–133
hit, 965
HOARE-PARTITION, 199 pr.
HOPCROFT-KARP, 709
Hopcroft-Karp algorithm, 709–715
HORNER, 47 pr.
Horner’s rule, 46 pr., 879, 963
HUFFMAN, 434
Human Genome Project, 6
HUNGARIAN, 737
Hungarian algorithm, 723–739, 740 pr.
hybrid cryptosystem, 941
hyperedge, 1167
hypergraph, 1167
hypotheses, 1003
ideal parallel computer, 756
idempotency laws, 1154
identity, 917
identity matrix, 1215
identity permutation, 138 ex.
if, in pseudocode, 22
ill-defined recurrence, 77
image, 1162
image compression, 412 pr.
incidence matrix
and difference constraints, 628
of a directed graph, 553 ex.
inclusion and exclusion, 1158 ex.
incomplete step, 759
INCREASE-KEY, 173
increasing a key, in a max-heap, 174–175
INCREMENT, 451
incremental design method, 34
incrementing, 21
in-degree, 1165
indentation in pseudocode, 21–22
independence
of random variables, 1192
of subproblems in dynamic programming, 386–387
independent family of hash functions, 288
independent set, 1099 pr.
independent uniform hash function, 276
independent uniform hashing, 276, 278
independent uniform permutation hashing, 295
indexing into an array, 22–23, 26 n., 252
index of an element of , 933
indicator random variable, 130–133
in approximation algorithm for MAX-3-CNF satisfiability, 1120–1121
in birthday paradox analysis, 142–143
in bounding the right tail of the binomial distribution, 1207–1208
in coin flipping analysis, 131–132
expected value of, 130
in the hat-check problem, 134 ex.
in hiring-problem analysis, 132–133
and linearity of expectation, 131
in quicksort analysis, 197–198, 200 pr.
in randomized caching analysis, 812
in randomized-selection analysis, 245 pr.
induced subgraph, 1166
inequality, linear, 853
infeasible linear program, 854
infeasible solution, 854
inference, 1004
infinite sequence, 1162
infinite set, 1156
infinite sum, 1140
infinity, arithmetic with, 611
initialization of a loop invariant, 20
INITIALIZE-SINGLE-SOURCE, 609
injective function, 1162
inner product, 1219
inorder tree walk, 314, 320 ex.
INORDER-TREE-WALK, 314
in-place permuting, 136
in-place sorting, 158, 220 pr.
in play, 232
input
to an algorithm, 5
to a combinational circuit, 1066
to a logic gate, 1065
size of, 28
input alphabet, 967
insertion
into binary search trees, 321–322
into chained hash tables, 278
into d-ary heaps, 179 pr.
into direct-address tables, 274
elementary, 461
into heaps, 175
into interval trees, 491
into linked lists, 260
into open-address hash tables, 293–294
into order-statistic trees, 484
into queues, 256
into stacks, 254
into Young tableaus, 179 pr.
insertion sort, 17–21, 29–31, 51–53, 56–57
compared with merge sort, 12–13, 15 ex.
compared with quicksort, 191 ex.
decision tree for, 206 fig.
in merge sort, 45 pr.
in quicksort, 198 ex.
using binary search, 45 ex.
instance
of an abstract problem, 1045, 1049
of a problem, 6
instructions of the RAM model, 26
integer data type, 26
integer linear programming, 857, 874 pr., 1098 ex.
integers (ℤ), 1153
integer-valued flow, 695
integrality theorem, 696
integral, to approximate summations, 1150
integration of a series, 1142
interior-point methods, 857
intermediate vertex, 655
internal node, 1172
internal path length, 1175 ex.
interpolation by a cubic spline, 847 pr.
interpolation by a polynomial, 880, 885 ex.
at complex roots of unity, 891–892
intersection
of chords, 486 ex.
of languages, 1052
of sets (∩), 1154
fuzzy sorting of, 203 pr.
interval graph, 425 ex.
INTERVAL-SEARCH-EXACTLY, 495 ex.
interval trichotomy, 490
intractability, 1042
invalid shift, 957
inventory planning, 414 pr.
inverse
of a bijective function, 1163
in a group, 917
of a matrix, 784 pr., 833–837, 1220
multiplicative, modulo n, 927
inversion
in an array, 47 pr.
in linked lists, 798
in a sequence, 134 ex., 486 ex.
inversion count, 798
inverter, 1065
invertible matrix, 1220
invocation tree, 756
isolated vertex, 1165
isomorphic graphs, 1166
iterated logarithm function (lg*), 68
ITERATIVE-TREE-SEARCH, 316
iter function, 536
Java Fork-Join Framework, 750
Jensen’s inequality, 1194
JOHNSON, 666
joining
of red-black trees, 356 pr.
of 2-3-4 trees, 518 pr.
joint probability density function, 1191
Josephus permutation, 496 pr.
Karmarkar’s algorithm, 876
Karp’s minimum mean-weight cycle algorithm, 642 pr.
k-ary tree, 1174
k-clustering, 1008
k-CNF, 1043
k-coloring, 1100 pr., 1176 pr.
k-combination, 1180
k-conjunctive normal form, 1043
Keeling curve, 845 fig.
key, 17, 157, 173, 249, 283–284
dummy, 400
median, of a B-tree node, 506
keywords, in pseudocode, 21–22, 24
parallel, 750, 752–754, 762–763
Kleene star (*), 1052
k-means problem, 1008
KMP-MATCHER, 978
knapsack problem
decision version, 1096
fractional, 429
k-neighbor tree, 358
knot, of a spline, 847 pr.
Knuth-Morris-Pratt algorithm, 975–985
Kraft inequality, 1176 ex.
with integer edge weights, 598 ex.
k-sorted, 221 pr.
k-string, 1179
k-subset, 1156
k-substring, 1179
k th power, 910 ex.
label
in machine learning, 1003, 1035
Lagrange’s formula, 881
Lagrange’s theorem, 921
Lamé’s theorem, 913
language, 1052
completeness of, 1072 ex.
proving NP-completeness of, 1072–1073
verification of, 1058
lasers, sharks with, 850
last-in, first-out (LIFO), 254, 803–804
implemented with a priority queue, 178 ex.
see also stack
latency, 499
LCA, 544 pr.
lcm (least common multiple), 916 ex.
LCP, see longest common prefix array
LCS-LENGTH, 397
leading submatrix, 839
leaf, 1172
least common multiple, 916 ex.
least frequently used (LFU), 803, 814 ex.
least recently used (LRU), 445 ex., 803–805
least-squares approximation, 841–845, 1035–1037
leaving a vertex, 1164
LEFT, 162
left child, 1173
left-child, right-sibling representation, 265, 268 ex.
left-leaning red-black binary search tree, 358
left rotation, 335
left shift (⋘), 305
left subtree, 1173
Legendre symbol
, 954 pr.
of a cycle, 1165
of a path, 1165
of a sequence, 1162
level
of a function, 532
of a node in a disjoint-set forest, 535
of a tree, 1173
lexicographically less than, 327 pr.
lexicographic sorting, 327 pr., 986 n.
LFU (least frequently used), 803, 814 ex.
lg (binary logarithm), 66
lg* (iterated logarithm function), 68
lg k (exponentiation of logarithms), 66
lg lg (composition of logarithms), 66
LIFO, see last-in, first-out; stack
light edge, 587
linear dependence, 1220
linear equality, 853
linear equations
solving systems of, 819–833, 1034–1035
solving tridiagonal systems of, 847 pr.
linear independence, 1220
linear inequality, 853
linear-inequality feasibility problem, 873 pr.
linearity of expectation, 1192–1193
and indicator random variables, 131
linearity of summations, 1141
linear order, 1160
linear permutation, 1224 pr.
LINEAR-PROBING-HASH-DELETE, 303
linear programming, 850–876, 1121–1124
ellipsoid algorithm for, 857
fundamental theorem of, 872
interior-point methods for, 857
Karmarkar’s algorithm for, 876
and maximum flow, 862
and minimum-cost circulation, 875 pr.
and minimum-cost flow, 862–864
and multicommodity flow, 864–865
simplex algorithm for, 857
and single-pair shortest path, 861
and single-source shortest paths, 626–632
standard form for, 854
see also integer linear programming, 0-1 integer programming
linear-programming relaxation, 1122
linear regression, 1036
linear search, 25 ex.
linear speedup, 758
line search, 1031
LINK, 530
compact, 269 pr.
deletion from, 261
to implement disjoint sets, 523–527
insertion into, 260
maintained by an online algorithm, 795–802
linking of trees in a disjoint-set forest, 529
list, see linked list
LIST-DELETE, 261
LIST-DELETE′, 262
LIST-INSERT, 261
LIST-INSERT′, 263
LIST-PREPEND, 260
LIST-SEARCH, 260
LIST-SEARCH′, 263
literal, 1076
little-oh notation ( o), 60
little-omega notation ( ω), 61
Lloyd’s procedure, 1011–1013, 1039 pr.
ln (natural logarithm), 66
load factor
of a dynamic table, 461
of a hash table, 278
local minimizer, 1026 fig.
local variable, 22
logarithm function (log), 66–67
discrete, 933
iterated (lg*), 68
logical parallelism, 753
logical right shift (⋙), 285
logic gate, 1065
longest common prefix ( LCP) array, 986, 992–994
longest common subsequence, 393–399
longest common substring, 995 ex.
longest monotonically increasing subsequence, 399 ex.
longest palindrome subsequence, 407 pr.
LONGEST-PATH, 1055 ex.
LONGEST-PATH-LENGTH, 1055 ex.
longest repeated substring, 987
longest simple cycle, 1098 ex.
longest simple path, 1042
in an unweighted graph, 385
in a weighted directed acyclic graph, 407 pr.
lookahead algorithm, 815 ex.
LOOKUP-CHAIN, 391
loop, in pseudocode, 22
for breadth-first search, 555
for building a heap, 167
for counting sort, 211 ex.
for determining the rank of an element in an order-statistic tree, 483
and for loops, 21 n.
for the generic minimum-spanning-tree method, 586
for heapsort, 172 ex.
for Horner’s rule, 46 pr.
for increasing a key in a heap, 177 ex.
for partitioning, 184
for Prim’s algorithm, 597
for the Rabin-Karp algorithm, 965
for randomly permuting an array, 137
for red-black tree insertion, 340
for string-matching automata, 970, 973
loss function, 1036
low endpoint of an interval, 489
lower bounds
asymptotic, 55
on binomial coefficients, 1181, 1184 ex.
for comparing water jugs, 220 pr.
for competitive ratios for online caching, 804–806
for constructing binary search trees, 315 ex.
for disjoint-set data structures, 545
for finding the minimum, 228
for k-sorting, 221 pr.
for median finding, 247
for merging, 222 pr.
and potential functions, 475
for simultaneous minimum and maximum, 229 ex.
for sorting, 205–208, 219 pr., 225
for task-parallel computations, 757
for traveling-salesperson tour, 1110–1113
for vertex cover, 1108, 1121–1123, 1132 pr.
lower median, 227
lower-triangular matrix, 1216
lowest common ancestor, 543 pr.
low side of a partition, 183
LRU (least recently used), 445 ex., 803–805
parallel algorithm for, 784 pr.
LU-DECOMPOSITION, 827
LUP decomposition, 821
and matrix multiplication, 838 ex.
parallel algorithm for, 784 pr.
LUP-DECOMPOSITION, 830
LUP-SOLVE, 824
machine learning, 14, 1003–1041
main memory, 498
maintenance of a loop invariant, 20
MAKE-RANKS, 988
MAKE-SET, 521
disjoint-set-forest implementation of, 530
linked-list implementation of, 523
makespan, 1133 pr.
MAKE-TREE, 542 pr.
Manhattan distance, 244 pr.
Markov’s inequality, 1196 ex.
master method for solving a recurrence, 101–107
master recurrence, 101
master theorem, 102
continuous, 112
fractional, 741 pr.
by Hopcroft-Karp algorithm, 709–715
stable, 716
unstable, 717
addition of, 1217
conjugate transpose of, 838 ex.
dense, 81
determinant of, 1221
diagonal, 1215
Hermitian, 838 ex.
Hessian, 1035
identity, 1215
incidence, 553 ex.
inverse of, 784 pr., 833–837, 1220
lower-triangular, 1216
minor of, 1221
multiplication of, see matrix multiplication
negative of, 1217
permutation, 1217
positive-definite, 1222
positive-semidefinite, 1222
predecessor, 647, 655 ex., 657–659, 661 ex.
product of, with a vector, 762–765, 767, 1218
pseudoinverse of, 843
scalar multiple of, 1217
sparse, 81
subtraction of, 1218
symmetric, 1217
symmetric positive-definite, 838–841
transpose of, 1214
tridiagonal, 1216
unit lower-triangular, 1216
unit upper-triangular, 1216
upper-triangular, 1216
matrix-chain multiplication, 373–382
MATRIX-CHAIN-MULTIPLY, 381 ex.
MATRIX-CHAIN-ORDER, 378
matrix multiplication, 80–90, 1218
for all-pairs shortest paths, 648–655, 668–669
divide-and-conquer method for, 81–90, 770–775, 783 pr.
and LUP decomposition, 838 ex.
Pan’s method for, 89 ex.
parallel algorithm for, 770–775, 783 pr.
Strassen’s algorithm for, 85–90, 124–125, 773–774
and transitive closure, 838 ex.
MATRIX-MULTIPLY, 81
MATRIX-MULTIPLY-RECURSIVE, 83
matrix-vector multiplication, 762–765, 767, 1218
MAX-CNF satisfiability, 1124 ex.
MAX-CUT problem, 1124 ex.
MAX-FLOW-BY-SCALING, 700 pr.
max-flow min-cut theorem, 684
max-heap, 162
d-ary, 179 pr.
deletion from, 178 ex.
extracting the maximum key from, 174
insertion into, 175
maximum key of, 174
as a max-priority queue, 172–178
mergeable, 268 n.
MAX-HEAP-DECREASE-KEY, 176 ex.
MAX-HEAP-DELETE, 178 ex.
MAX-HEAP-EXTRACT-MAX, 175
MAX-HEAPIFY, 165
MAX-HEAP-INCREASE-KEY, 176
MAX-HEAP-INSERT, 176
building a heap with, 178 pr.
MAX-HEAP-MAXIMUM, 175
max-heap property, 162
maximal element, 1160
maximal matching, 705, 1108, 1132 pr.
greedy method for, 726
maximization linear program, 853
maximum, 227
in binary search trees, 317–318
of a binomial distribution, 1202 ex.
in heaps, 174
in red-black trees, 334
maximum bipartite matching, 693–697, 705–716
Edmonds-Karp algorithm for, 689–691
Ford-Fulkerson method for, 676–693
as a linear program, 862
and maximum bipartite matching, 693–697
push-relabel algorithms for, 702
scaling algorithm for, 699 pr.
updating, 699 pr.
maximum matching, 693, 704, 1132 pr.
see also maximum bipartite matching
maximum spanning tree, 1134 pr.
max-priority queue, 173
MAX-3-CNF satisfiability, 1120–1121
MAYBE-MST-A, 602 pr.
MAYBE-MST-B, 602 pr.
MAYBE-MST-C, 602 pr.
mean
of a cluster, 1009
see also expected value
mean weight of a cycle, 642 pr.
weighted, 244 pr.
median key, of a B-tree node, 506
median-of-3 method, 203 pr.
member of a set (∈), 1153
MEMOIZED-CUT-ROD, 369
MEMOIZED-CUT-ROD-AUX, 369
MEMOIZED-MATRIX-CHAIN, 391
MERGE, 36
mergeable heap, 268 pr.
MERGE-LISTS, 1125
compared with insertion sort, 12–13, 15 ex.
lower bound for, 207
parallel algorithm for, 775–782
use of insertion sort in, 45 pr.
MERGE-SORT, 39
merging
of k sorted lists, 178 ex.
lower bounds for, 222 pr.
parallel algorithm for, 776–780
of two sorted subarrays, 35–38
MILLER-RABIN, 946
Miller-Rabin primality test, 945–953
MIN-GAP, 495 ex.
min-heap, 163
analyzed by potential method, 459 ex.
in constructing Huffman codes, 436
d-ary, 668 pr.
in Dijkstra’s algorithm, 623
in Johnson’s algorithm, 666
mergeable, 268 n.
as a min-priority queue, 176 ex.
in Prim’s algorithm, 597
MIN-HEAPIFY, 166 ex.
MIN-HEAP-INSERT, 176 ex.
min-heap property, 163
maintenance of, 166 ex.
vs. binary-search-tree property, 315 ex.
minimization linear program, 853
minimizer of a function, 1022, 1024 fig., 1026 fig.
minimum, 227
in binary search trees, 317–318
offline, 541 pr.
in red-black trees, 334
minimum-cost circulation, 875 pr.
minimum-cost multicommodity flow, 866 ex.
minimum-cost spanning tree, see minimum spanning tree
minimum cut, 682
global, 701 pr.
minimum degree, of a B-tree, 502
minimum mean-weight cycle, 642 pr.
minimum path cover, 698 pr.
minimum spanning tree, 585–603
in approximation algorithm for traveling-salesperson problem, 1110
Borůvka’s algorithm for, 603
on dynamic graphs, 599 ex.
Kruskal’s algorithm for, 592–594
second-best, 599 pr.
minimum-weight spanning tree, see minimum spanning tree
minimum-weight vertex cover, 1121–1124
minor of a matrix, 1221
min-priority queue, 173
in constructing Huffman codes, 434
in Dijkstra’s algorithm, 623–624
missing child, 1173
modeling, 851
modifying operation, 250
modular arithmetic, 64, 901 pr., 916–923
modular equivalence (= (mod n)), 64, 905
modular exponentiation, 934–935
MODULAR-EXPONENTIATION, 935
modular linear equations, 924–928
MODULAR-LINEAR-EQUATION-SOLVER, 926
Monge array, 123 pr.
monotone sequence, 181
monotonically decreasing, 63
monotonically increasing, 63
Monty Hall problem, 1210 pr.
MST-KRUSKAL, 594
MST-PRIM, 596
MST-REDUCE, 601 pr.
much-greater-than (≫), 533
much-less-than (≪), 761
multicore computer, 748
multidimensional fast Fourier transform, 899 pr.
multigraph, 1167
multiple, 904
of an element modulo n, 924–928
least common, 916 ex.
scalar, 1217
multiple sources and sinks, 674
multiplication
of complex numbers, 90 ex.
divide-and-conquer method for, 899 pr.
of matrices, see matrix multiplication
matrix-vector, 762–765, 767, 1218
modulo n (· n), 917
of polynomials, 878
multiplication method, 284–286
multiplicative group modulo n, 919
multiplicative inverse, modulo n, 927
multiplicative weights, 1015–1022
multiply instruction, 26
multiply-shift method, 285–286
MULTIPOP, 450
multiset, 1153 n.
dynamic, 460 ex.
mutually exclusive events, 1185
mutually independent events, 1188
mutually noninterfering strands, 767
ℕ (set of natural numbers), 1153
naive algorithm for string matching, 960–962
NAIVE-STRING-MATCHER, 960
National Resident Matching Program, 704, 722 ex.
natural cubic spline, 847 pr.
natural logarithm (ln), 66
natural numbers (ℕ), 1153
nearest-center rule, 1008
negative of a matrix, 1217
negative-weight cycle
and difference constraints, 629
and relaxation, 639 ex.
and shortest paths, 606–607, 614–615, 655 ex., 662 ex.
negative-weight edges, 606–607
neighbor, 1167
neighborhood, 715 ex.
nesting boxes, 640 pr.
net flow across a cut, 682
network
flow, see flow network
for sorting, 789
new request, 810
Newton’s method, 1038 pr.
NIL, 23
node, 1172
see also vertex
nondeterministic algorithm, 765
nondeterministic polynomial time, 1058 n.
see also NP
nonempty suffix, 997 pr.
nonhamiltonian graph, 1056
noninstance, 1051 n.
noninvertible matrix, 1220
nonnegativity constraint, 854
nonoblivious adversary, 807
nonoverlappable string pattern, 974 ex.
nonsample position, 997 pr.
nonsample suffix, 997 pr.
nonsingular matrix, 1220
nontrivial power, 910 ex.
nontrivial square root of 1, modulo n, 934
normal equation, 843
norm of a vector (∥ ∥), 1219
NOT function (¬), 1065
not a set member (∉ ), 1153
not equivalent (≠ (mod n)), 64
NOT gate, 1065
NP (complexity class), 1043, 1058, 1060 ex.
NPC (complexity class), 1044, 1063
NP-completeness, 9–10, 1042–1103
of the circuit-satisfiability problem, 1064–1071
of the clique problem, 1081–1084
of the formula-satisfiability problem, 1073–1076
of the graph-coloring problem, 1100 pr.
of the half 3-CNF satisfiability problem, 1099 ex.
of the hamiltonian-cycle problem, 1085–1090
of the hamiltonian-path problem, 1098 ex.
of the independent-set problem, 1099 pr.
of integer linear programming, 1098 ex.
of the longest-simple-cycle problem, 1098 ex.
proving, of a language, 1072–1073
reduction strategies for, 1095–1098
of scheduling with profits and deadlines, 1102 pr.
of the set-covering problem, 1119 ex.
of the set-partition problem, 1098 ex.
of the subgraph-isomorphism problem, 1098 ex.
of the subset-sum problem, 1092–1095
of the 3-CNF-satisfiability problem, 1076–1079
of the traveling-salesperson problem, 1090–1092
of the vertex-cover problem, 1084–1085
of 0-1 integer programming, 1098 ex.
NP-hard, 1063
n-set, 1156
n-tuple, 1157
null event, 1185
null tree, 1173
null vector, 1221
number-field sieve, 956
n-vector, 1215
o-notation, 60
O′-notation, 73 pr.
-notation, 73 pr.
object, 23
objective function, 626, 852, 854
objective value, 854
oblivious adversary, 807
oblivious compare-exchange algorithm, 222 pr.
occurrence of a pattern, 957
offline algorithm, 791
OFFLINE-MINIMUM, 542 pr.
offline problem
lowest common ancestors, 543 pr.
minimum, 541 pr.
old request, 810
Omega-notation, 51, 54 fig., 55–56
1-approximation algorithm, 1105
one-pass method, 544
one-to-one correspondence, 1163
one-to-one function, 1162
for the cow-path problem, 815 pr.
for maintaining a linked list, 795–802
for task scheduling, 816 pr.
for waiting for an elevator, 792–794
online learning, 1003
ONLINE-MAXIMUM, 150
online task-parallel scheduler, 759
onto function, 1162
open-address hash table, 293–301, 308 pr.
with double hashing, 295–297, 301 ex.
with linear probing, 297, 302–304
open interval (( a, b)), 1157
OpenMP, 750
optimal binary search tree, 400–407
OPTIMAL-BST, 405
optimal objective value, 854
optimal solution, 854
of activity selection, 419
of binary search trees, 402–403
of the fractional knapsack problem, 429
in greedy method, 428
of Huffman codes, 438
of longest common subsequences, 394–395
of matrix-chain multiplication, 376
of rod cutting, 365
of shortest paths, 605–606, 649, 655–656
of unweighted shortest paths, 385
of the 0-1 knapsack problem, 429
optimal vertex cover, 1106
optimization problem, 362, 1045, 1049
approximation algorithms for, 1104–1136
and decision problems, 1045
order
of a group, 922
of growth, 32
linear, 1160
partial, 1160
total, 1160
ordered pair, 1156
ordered tree, 1173
order statistics, 160, 227–247
ord function, 987
OR gate, 1065
or, in pseudocode, 24
orthonormal, 849
OS-KEY-RANK, 485 ex.
OS-RANK, 483
OS-SELECT, 482
outcome, 1185
out-degree, 1165
outer product, 1219
output
of an algorithm, 5
of a combinational circuit, 1066
of a logic gate, 1065
overdetermined system of linear equations, 821
overflow
of a queue, 257
of a stack, 255
overflowing vertex, 703
overlapping intervals, 489
finding all, 495 ex.
point of maximum overlap, 496 pr.
overlapping rectangles, 495 ex.
overlapping subproblems, 387–390
overlapping-suffix lemma, 959
P (complexity class), 1043, 1050, 1054, 1055 ex.
page, in virtual memory, 440
pair
blocking, 716
ordered, 1156
pairwise disjoint sets, 1156
pairwise independence, 1188
pairwise relatively prime, 908
Pan’s method for matrix multiplication, 89 ex.
for computing Fibonacci numbers, 750–753
grain size in, 783 pr.
for LU decomposition, 784 pr.
for LUP decomposition, 784 pr.
for matrix inversion, 784 pr.
for matrix multiplication, 770–775, 783 pr.
for matrix-vector product, 762–765, 767
for prefix computation, 784 pr.
for quicksort, 789 pr.
randomized, 789 pr.
for reduction, 784 pr.
for a simple stencil calculation, 787 pr.
for solving systems of linear equations, 784 pr.
for well-formed parentheses, 786 pr.
parallel computer, 10, 748, 756
parallel for, in pseudocode, 762–763
parallelism
logical, 753
of a randomized parallel algorithm, 789 pr.
spawning, 753
syncing, 754
of a task-parallel computation, 758
parallel keywords, 750, 752, 762
parallel loop, 762–765, 783 pr.
parallel-machine-scheduling problem, 1133 pr.
parallel prefix, 784 pr.
parallel random-access machine, 789
parallel slackness, 758
rule of thumb, 761
parallel, strands logically in, 756
series-parallel composition of, 762 fig.
parameter, 23
costs of passing, 120 pr.
parent
in a breadth-first tree ( π), 555
in a parallel computation, 753
in a rooted tree, 1172
PARENT, 162
parenthesis theorem, 567
parenthesization of a matrix-chain product, 374
Pareto optimality, 722 ex.
parse tree, 1077
partial derivative (∂), 1023
partial order, 1160
PARTITION, 184
PARTITION′, 200 pr.
PARTITION-AROUND, 237
partition function, 363 n.
around median of 3 elements, 198 ex.
helpful, 232
Hoare’s method for, 199 pr.
randomized, 192, 198 ex., 200 pr., 203 pr.
partition of a set, 1156, 1159
Pascal’s triangle, 1183 ex.
path, 1165
alternating, 705
critical, 619
find, 528
hamiltonian, 1060 ex., 1098 ex.
shortest, see shortest paths
simple, 1165
path compression, 528
path cover, 698 pr.
path length, of a tree, 328 pr., 1175 ex.
path-relaxation property, 611, 635
pattern, 957
nonoverlappable, 974 ex.
pattern matching, see string matching
perfect hashing, 310
perfect linear speedup, 758
perfect matching, 715 ex., 740 pr.
bit-reversal, 897
identity, 138 ex.
in place, 136
Josephus, 496 pr.
linear, 1224 pr.
permutation matrix, 1217
PERMUTE-BY-CYCLE, 139 ex.
PERMUTE-WITH-ALL, 139 ex.
PERMUTE-WITHOUT-IDENTITY, 138 ex.
persistent data structure, 355 pr., 478
PERSISTENT-TREE-INSERT, 355 pr.
P-FIB, 753
phi function ( ϕ( n)), 920
pivot
in LU decomposition, 826
in quicksort, 183
in selection, 230
P[: k] (prefix of a pattern), 959
planar graph, 584 pr.
platter in a disk drive, 498
P-MATRIX-MULTIPLY, 771
P-MATRIX-MULTIPLY-RECURSIVE, 772
P-MAT-VEC, 763
P-MAT-VEC-RECURSIVE, 763
P-MAT-VEC-WRONG, 768
P-MERGE, 779
P-MERGE-AUX, 779
P-MERGE-SORT, 775
P-NAIVE-MERGE-SORT, 775
pointer, 23
trailing, 321
point, in clustering, 1006
point-value representation, 880
polylogarithmically bounded, 67
addition of, 877
asymptotic behavior of, 71 pr.
coefficient representation of, 879
derivatives of, 900 pr.
evaluation of, 46 pr., 879, 884 ex., 900 pr.
interpolation by, 880, 885 ex.
multiplication of, 878, 882–884, 899 pr.
point-value representation of, 880
polynomial-growth condition, 116–117
polynomially bounded, 65
polynomially related, 1051
polynomial-time acceptance, 1053
polynomial-time algorithm, 904, 1042
polynomial-time approximation scheme, 1105
for maximum clique, 1131 pr.
polynomial-time computability, 1051
polynomial-time decision, 1053
polynomial-time reducibility (≤P), 1062, 1071 ex.
polynomial-time solvability, 1050
polynomial-time verification, 1056–1061
pop from a runtime stack, 202 pr.
positional tree, 1174
positive-definite matrix, 1222
positive-semidefinite matrix, 1222
post-office location problem, 244 pr.
postorder tree walk, 314
potential function, 456
for lower bounds, 475
for disjoint-set data structures, 534–540, 541 ex.
for maintaining a linked list, 799–801
for min-heaps, 459 ex.
for restructuring red-black trees, 473 pr.
potential of a data structure, 456
power
of an element, modulo n, 932–936
k th, 910 ex.
nontrivial, 910 ex.
power series, 121 pr.
power set, 1156
Pr { } (probability distribution), 1185
PRAM, 789
predecessor
in binary search trees, 318–319
in breadth-first trees ( π), 555
in linked lists, 259
in red-black trees, 334
in shortest-paths trees ( π), 608
PREDECESSOR, 250
predecessor matrix, 647, 655 ex., 657–659, 661 ex.
predecessor subgraph
in all-pairs shortest paths, 647
in breadth-first search, 561
in depth-first search, 564
in single-source shortest paths, 608
predecessor-subgraph property, 611, 637–638
prediction, 1004
prediction phase, 1003
prefix
of a sequence, 395
of a string (⊏), 959
prefix computation, 784 pr.
prefix-free code, 432
prefix-function iteration lemma, 980
preflow, 703
preimage of a matrix, 1224 pr.
preorder, total, 1160
preorder tree walk, 314
with an adjacency matrix, 598 ex.
in approximation algorithm for traveling-salesperson problem, 1110
with integer edge weights, 598 ex.
similarity to Dijkstra’s algorithm, 624
for sparse graphs, 599 pr.
primality testing, 942–953, 956
pseudoprimality testing, 944–945
primal linear program, 866
augmented, 870
primary clustering, 303
prime distribution function, 943
prime factorization of integers, 909
prime number, 905
density of, 943
prime number theorem, 943
primitive root of , 932
principal root of unity, 886
principle of inclusion and exclusion, 1158 ex.
PRINT-ALL-PAIRS-SHORTEST-PATH, 648
PRINT-CUT-ROD-SOLUTION, 372
PRINT-LCS, 397
PRINT-OPTIMAL-PARENS, 381
PRINT-PATH, 562
PRINT-SET, 531 ex.
in constructing Huffman codes, 434
in Dijkstra’s algorithm, 623–624
heap implementation of, 172–178
max-priority queue, 173
min-priority queue, 173, 176 ex.
with monotone extractions, 181
see also Fibonacci heap
probabilistically checkable proof, 1103, 1136
probabilistic analysis, 127–128, 140–153
of approximation algorithm for MAX-3-CNF satisfiability, 1120–1121
and average inputs, 32
of average node depth in a randomly built binary search tree, 328 pr.
of bucket sort, 216–218, 218 ex.
of collisions, 281 ex.
of file comparison, 967 ex.
of fuzzy sorting of intervals, 203 pr.
of hashing with chaining, 278–281
of hiring problem, 132–133, 150–152
of insertion into a binary search tree with equal keys, 327 pr.
of longest probe bound for hashing, 308 pr.
of lower bound for sorting, 219 pr.
of Miller-Rabin primality test, 948–953
of online hiring problem, 150–152
of open-address hashing, 297–300
and parallel algorithms, 789 pr.
of partitioning, 191 ex., 198 ex., 200 pr., 203 pr.
of probabilistic counting, 153 pr.
of quicksort, 194–198, 200 pr., 203 pr.
of Rabin-Karp algorithm, 965–966
and randomized algorithms, 134–136
of randomized online caching, 809–814
of randomized selection, 232–236, 245 pr.
of randomized weighted majority, 1022 ex.
of searching a sorted compact list, 269 pr.
of slot-size bound for chaining, 308 pr.
of sorting points by distance from origin, 218 ex.
probabilistic counting, 153 pr.
probability axioms, 1185
probability density function, 1191
probability distribution, 1185
probability distribution function, 218 ex.
probe sequence, 293
probing, 293
see also linear probing, double hashing
problem
abstract, 1048
concrete, 1049
intractable, 1042
tractable, 1042
procedure, 18
product (∏), 1144
Cartesian (×), 1157
inner, 1219
of matrices, see matrix multiplication
outer, 1219
of polynomials, 878
rule of, 1179
scalar flow, 675 ex.
professional wrestler, 563 ex.
program counter, 1068
programming, see dynamic programming, linear programming
projection, 1032
proper ancestor, 1172
proper descendant, 1172
proper prefix, 959
proper subgroup, 921
proper subset (⊂), 1154
proper suffix, 959
P-SCAN-1, 785 pr.
P-SCAN-1-AUX, 785 pr.
P-SCAN-2, 786 pr.
P-SCAN-2-AUX, 786 pr.
P-SCAN-3, 787 pr.
P-SCAN-DOWN, 787 pr.
P-SCAN-UP, 787 pr.
pseudoinverse, 843
PSEUDOPRIME, 945
pseudorandom-number generator, 129
P-TRANSPOSE, 770 ex.
public-key cryptosystem, 936–942
push onto a runtime stack, 202 pr.
push-relabel algorithms, 702
quadratic convergence, 1039 pr.
quadratic function, 31
quadratic residue, 954 pr.
quantile, 242 ex.
query, 250
in breadth-first search, 554
implemented by stacks, 258 ex., 460 ex.
linked-list implementation of, 264 ex.
priority, see priority queue
average-case analysis of, 194–198
compared with insertion sort, 191 ex.
compared with radix sort, 214
with equal element values, 200 pr.
good worst-case implementation of, 241 ex.
with median-of-3 method, 203 pr.
parallel algorithm for, 789 pr.
randomized version of, 191–193, 200 pr., 203 pr.
stack depth of, 202 pr.
and tail recursion, 202 pr.
use of insertion sort in, 198 ex.
worst-case analysis of, 193–194
QUICKSORT, 183
QUICKSORT′, 200 pr.
quotient, 905
ℝ (set of real numbers), 1153
RABIN-KARP-MATCHER, 966
RACE-EXAMPLE, 766
compared with quicksort, 214
in computing suffix arrays, 992
RADIX-SORT, 213
radix tree, 327 pr.
RANDOM, 129
parallel, 789
randomized algorithm, 128–129, 134–140
and average inputs, 32
comparison sort, 219 pr.
for fuzzy sorting of intervals, 203 pr.
for insertion into a binary search tree with equal keys, 327 pr.
for MAX-3-CNF satisfiability, 1120–1121
Miller-Rabin primality test, 945–953
parallel, 789 pr.
for partitioning, 192, 198 ex., 200 pr., 203 pr.
for permuting an array, 136–138
and probabilistic analysis, 134–136
quicksort, 191–193, 200 pr., 203 pr.
randomized rounding, 1136
for searching a sorted compact list, 269 pr.
for selection, 230–236, 245 pr.
for weighted majority, 1022 ex.
RANDOMIZED-HIRE-ASSISTANT, 135
RANDOMIZED-MARKING, 808
RANDOMIZED-PARTITION, 192
RANDOMIZED-PARTITION′, 200 pr.
RANDOMIZED-QUICKSORT, 192
relation to randomly built binary search trees, 328 pr.
randomized rounding, 1136
RANDOMIZED-SELECT, 230
randomly built binary search tree, 328 pr.
RANDOMLY-PERMUTE, 136, 138 ex.
random-number generator, 129
random oracle, 276
RANDOM-SAMPLE, 139 ex.
RANDOM-SEARCH, 154 pr.
indicator, see indicator random variable
range, 1162
of a matrix, 1224 pr.
rank
column, 1220
in computing suffix arrays, 987
full, 1220
of a node in a disjoint-set forest, 528, 533–534, 540 ex.
of a number in an ordered set, 480
in order-statistic trees, 482–484, 485–486 ex.
row, 1220
rate of growth, 32
RB-DELETE, 348
RB-DELETE-FIXUP, 351
RB-ENUMERATE, 355 ex.
RB-INSERT, 338
RB-INSERT-FIXUP, 339
RB-JOIN, 356 pr.
RB-TRANSPLANT, 347
RC6, 304
reachability in a graph (↝), 1165
real numbers (ℝ), 1153
reconstructing an optimal solution, in dynamic programming, 390
rectangle, 495 ex.
RECTANGULAR-MATRIX-MULTIPLY, 374
inequalities in, 78
master, 101
solution by Akra-Bazzi method, 117–118
solution by master method, 101–107
solution by recursion-tree method, 95–101
solution by substitution method, 90–95
recursion, 34
in matrix-chain multiplication analysis, 388–390
in proof of continuous master theorem, 108–110
in quicksort analysis, 188–190
in rod cutting analysis, 366–367
and the substitution method, 98
RECURSIVE-ACTIVITY-SELECTOR, 422
recursive case, 34
of a divide-and-conquer algorithm, 76
of a recurrence, 77
RECURSIVE-MATRIX-CHAIN, 389
compared with B-trees, 497, 503
for enumerating keys in a range, 355 ex.
height of, 332
joining of, 356 pr.
left-leaning, 358
maximum key of, 334
minimum key of, 334
in order-statistic trees, 480–486
persistent, 355 pr.
predecessor in, 334
relaxed, 334 ex.
restructuring, 473 pr.
searching in, 334
successor in, 334
see also interval tree, order-statistic tree
REDUCE, 784 pr.
reduction algorithm, 1046, 1062
reduction function, 1062
reduction, of an array, 784 pr.
reduction strategies, 1095–1098
reference, 23
reflexive relation, 1158
reflexivity of asymptotic notation, 61
region, feasible, 854
regret, 1016
regular graph, 716 ex., 740 pr.
regularity condition, 103, 112, 114 ex.
regularization, 1012, 1036–1037
reindexing summations, 1143–1144
reinforcement learning, 1004
rejection
by an algorithm, 1053
by a finite automaton, 968
relatively prime, 908
RELAX, 610
relaxation
linear programming, 1122
relaxed red-black tree, 334 ex.
release time, 446 pr., 816 pr.
remainder instruction, 26
repeated squaring
for all-pairs shortest paths, 652–653
for raising a number to a power, 934
repeat, in pseudocode, 22
repetition factor, of a string, 996 pr.
REPETITION-MATCHER, 996 pr.
representative of a set, 520
RESET, 456 ex.
residual edge, 678
respecting a set of edges, 587
return, in pseudocode, 24
return instruction, 26
reweighting
in all-pairs shortest paths, 662–664
in single-source shortest paths, 641 pr.
ρ( n)-approximation algorithm, 1104, 1120
RIGHT, 162
right child, 1173
right-conversion, 337 ex.
RIGHT-ROTATE, 336
right rotation, 335
right shift (⋙), 285
right subtree, 1173
root
of a tree, 1171
of , 932
rooted tree, 1171
rounding, 1122
randomized, 1136
row rank, 1220
row vector, 1215
RSA public-key cryptosystem, 936–942
rule of product, 1179
rule of sum, 1178
running time, 29
asymptotic, 49
best-case, 34 ex.
of a graph algorithm, 548
order of growth, 32
and proper use of asymptotic notation, 56–57
rate of growth, 32
worst-case, 31
SA, see suffix array
sabermetrics, 415 n.
safe edge, 587
SAME-COMPONENT, 522
sample position, 997 pr.
sample space, 1185
sample suffix, 997 pr.
sampling, 139 ex.
SAT, 1074
satisfiability, 1066, 1073–1079, 1120–1121, 1124 ex.
satisfiable formula, 1043, 1074
satisfying assignment, 1066, 1074
scalar, 1217
scalar flow product, 675 ex.
scaling
in maximum flow, 699 pr.
in single-source shortest paths, 641 pr.
scan, 784 pr.
SCAN, 785 pr.
scapegoat tree, 358
schedule, 1133 pr.
scheduler for task-parallel computations, 753, 759–761, 769 ex., 789
scheduling, 446 pr., 816 pr., 1102 pr., 1133 pr.
Schur complement lemma, 840
SCRAMBLE-SEARCH, 154 pr.
seam carving, 412 pr.
SEARCH, 250
searching
binary search, 44 ex., 777–778
in binary search trees, 316–317
in chained hash tables, 278
in direct-address tables, 274
for an exact interval, 495 ex.
linear search, 25 ex.
in linked lists, 260
in open-address hash tables, 294
in red-black trees, 334
in sorted compact lists, 269 pr.
of static sets, 308 pr.
in an unsorted array, 154 pr.
search list, see linked list
search tree, see balanced search tree, binary search tree, B-tree, exponential search tree, interval tree, optimal binary search tree, order-statistic tree, red-black tree, splay tree, 2-3 tree, 2-3-4
tree
secondary storage
stacks on, 517 pr.
second-best minimum spanning tree, 599 pr.
SELECT, 237
used in quicksort, 241 ex.
SELECT3, 247 pr.
selection, 227
and comparison sorts, 241
in order-statistic trees, 481–482
in worst-case linear time, 236–243
selection sort, 33 ex., 53 ex.
selector vertex, 1087
self-loop, 1164
semiconnected graph, 581 ex.
sentinel
in red-black trees, 332
sequence (〈 〉), 1162
bitonic, 644 pr.
inversion in, 134 ex., 486 ex.
probe, 293
sequential consistency, 756
serial algorithm versus parallel algorithm, 748
strands logically in, 756
series-parallel composition of parallel traces, 762 fig.
cardinality (| |), 1156
collection of, 1156
convex, 675 ex.
difference (−), 1154
independent, 1099 pr.
intersection (∩), 1154
member (∈), 1153
not a member (∉ ), 1153
partially ordered, 1160
static, 308 pr.
union (∪ ), 1154
set-covering problem, 1115–1119
weighted, 1132 pr.
set-partition problem, 1098 ex.
SHA-256, 291
shared memory, 748
sharks with lasers, 850
Shell’s sort, 48
shift
left (⋘), 305
right (⋙), 285
in string matching, 957
shift instruction, 27
short-circuiting operator, 24
SHORTEST-PATH, 1045
Bellman-Ford algorithm for, 612–616
with bitonic shortest paths, 644 pr.
and breadth-first search, 558–561, 605
convergence property of, 611, 634–635
and difference constraints, 626–632
Dijkstra’s algorithm for, 620–626
in a directed acyclic graph, 616–619
distance in ( δ), 558
in ϵ-dense graphs, 668 pr.
estimate of, 609
Floyd-Warshall algorithm for, 655–659, 662 ex.
Gabow’s scaling algorithm for, 641 pr.
Johnson’s algorithm for, 662–667
as a linear program, 861
and longest paths, 1042
by matrix multiplication, 648–655, 668–669
and negative-weight cycles, 606–607, 614–615, 655 ex., 662 ex.
with negative-weight edges, 606–607
optimal substructure of, 605–606, 649, 655–656
path-relaxation property of, 611, 635
predecessor in ( π), 608
predecessor-subgraph property of, 611, 637–638
problem variants, 605
single-destination, 605
triangle inequality of, 611, 633
in an unweighted graph, 385, 558
upper-bound property of, 611, 633–634
in a weighted graph, 604
weight in ( δ), 604
shortest remaining processing time (SRPT), 816 pr.
sibling, 1172
signature, 938
simple graph, 1166
simple path, 1165
SIMPLER-RANDOMIZED-SELECT, 243 pr.
simplex, 857
simplex algorithm, 626, 857, 876
single-destination shortest paths, 605
single-pair shortest path, 385, 605
as a linear program, 861
single-source shortest paths, 604–645
Bellman-Ford algorithm for, 612–616
with bitonic shortest paths, 644 pr.
and difference constraints, 626–632
Dijkstra’s algorithm for, 620–626
in a directed acyclic graph, 616–619
in ϵ-dense graphs, 668 pr.
Gabow’s scaling algorithm for, 641 pr.
and longest paths, 1042
singleton, 1156
singly connected graph, 572 ex.
singly linked list, 259
singular matrix, 1220
singular value decomposition, 849
sink vertex, 553 ex., 671, 674
size
of an algorithm’s input, 28, 903–904, 1049–1052
of a boolean combinational circuit, 1067
of a clique, 1081
of a group, 917
of a set, 1156
skip list, 359
slackness
complementary, 873 pr.
parallel, 758
slot
of a direct-access table, 273
of a hash table, 275
SLOW-APSP, 652
smoothed analysis, 876
solution
to an abstract problem, 1049
to a computational problem, 6
to a concrete problem, 1049
infeasible, 854
optimal, 854
to a system of linear equations, 820
sorted linked list, 259
sorting, 5, 17–21, 34–44, 51–53, 56–57, 157–226, 775–782
bubblesort, 46 pr.
columnsort, 222 pr.
comparison sort, 205
fuzzy, 203 pr.
insertion sort, 12–13, 17–21, 51–53, 56–57
k-sorting, 221 pr.
lexicographic, 327 pr., 986 n.
in linear time, 208–219, 220 pr.
lower bounds for, 205–208, 225
merge sort, 12–13, 34–44, 57, 775–782
by an oblivious compare-exchange algorithm, 222 pr.
parallel quicksort, 789 pr.
probabilistic lower bound for, 219 pr.
selection sort, 33 ex., 53 ex.
Shell’s sort, 48
stable, 210
table of running times, 159
using a binary search tree, 326 ex.
with variable-length items, 220 pr.
0-1 sorting lemma, 222 pr.
sorting network, 789
source vertex, 554, 605, 671, 674
span, 757
span law, 758
spanning tree, 585
bottleneck, 601 pr.
maximum, 1134 pr.
verification of, 603
see also minimum spanning tree
sparse graph, 549
all-pairs shortest paths for, 662–667
and Prim’s algorithm, 599 pr.
sparse matrix, 81
spawning, 753
speedup, 758
of a randomized parallel algorithm, 789 pr.
spindle in a disk drive, 498
spine of a string-matching automaton, 970
splicing
in a binary search tree, 324–325
spline, 847 pr.
splitting
of 2-3-4 trees, 518 pr.
splitting summations, 1148–1149
spurious hit, 965
square matrix, 1215
square of a directed graph, 553 ex.
square root, modulo a prime, 954 pr.
squaring, repeated
for all-pairs shortest paths, 652–653
for raising a number to a power, 934
SRPT (shortest remaining processing time), 816 pr.
stability
of sorting algorithms, 210
stable-marriage problem, 716–723
stable matching, 716
stable-roommates problem, 723 ex.
implemented by queues, 258 ex.
implemented with a priority queue, 178 ex.
linked-list implementation of, 264 ex.
operations analyzed by accounting method, 454–455
operations analyzed by aggregate analysis, 449–451
operations analyzed by potential method, 457–458
for procedure execution, 202 pr.
on secondary storage, 517 pr.
STACK-EMPTY, 255
standard deviation, 1195
standard encoding (〈 〉), 1052
standard form of a linear program, 854
start state, 967
start time, 418
state of a finite automaton, 967
static graph, 522
static set, 308 pr.
stencil, 787 pr.
Stirling’s approximation, 67
stochastic gradient descent, 1040 pr.
STOOGE-SORT, 202 pr.
strand, 754
mutually noninterfering, 767
Strassen’s algorithm, 85–90, 124–125
parallel algorithm for, 773–774
streaming algorithms, 818
strict Fibonacci heap, 478
strictly decreasing, 63
strictly increasing, 63
interpreted as a key, 290–291, 292 ex.
based on repetition factors, 996 pr.
with gap characters, 961 ex., 975 ex.
Knuth-Morris-Pratt algorithm for, 975–985
Rabin-Karp algorithm for, 962–967
string-matching automaton, 968–975
strongly connected component, 1166
STRONGLY-CONNECTED-COMPONENTS, 577
strongly connected graph, 1166
subgraph, 1166
equality, 724
predecessor, see predecessor subgraph
subgraph-isomorphism problem, 1098 ex.
subpath, 1165
subsequence, 394
SUBSET-SUM, 1092
subset-sum problem
approximation algorithm for, 1124–1130
with unary target, 1098 ex.
in quicksort analysis, 191 ex., 193–194
and recursion trees, 98
in selection analysis, 240–241
rank of, 987
subtracting a low-order term, in the substitution method, 92–93
subtract instruction, 26
subtraction of matrices, 1218
subtree, 1172
maintaining size of, in order-statistic trees, 484–485
success, in a Bernoulli trial, 1196
in binary search trees, 318–319
finding i th, of a node in an order-statistic tree, 486 ex.
in linked lists, 259
in red-black trees, 334
SUCCESSOR, 250
such that (:), 1154
suffix (⊐), 959
suffix array ( SA), 985–996, 997 pr.
suffix function, 968
suffix-function inequality, 971
suffix-function recursion lemma, 972
sum (∑), 1140
Cartesian, 885 ex.
of matrices, 1217
of polynomials, 877
rule of, 1178
telescoping, 1143
SUM-ARRAY, 25 ex.
SUM-ARRAYS, 783 pr.
SUM-ARRAYS′, 783 pr.
approximated by integrals, 1150
in asymptotic notation, 58, 1141
formulas and properties of, 1140–1145
linearity of, 1141
summation lemma, 887
supercomputer, 748
superpolynomial time, 1042
supersink, 674
supersource, 674
supervised learning, 1004
surjection, 1162
SVD, 849
symbol table, 272
symmetric difference, 706
symmetric-key cryptosystem, 941
symmetric matrix, 1217
symmetric positive-definite matrix, 838–841
inverse of, 784 pr.
symmetric relation, 1159
symmetry of Θ-notation, 61
system of difference constraints, 626–632
system of linear equations, 784 pr., 819–833, 847 pr., 1034–1035
TABLE-DELETE, 467
TABLE-INSERT, 462
tail
of a binomial distribution, 1203–1210
of a linked list, 259
of a queue, 256
target, 1092
Tarjan’s offline lowest-common-ancestors algorithm, 543 pr.
task parallelism, 749
see also parallel algorithm
Task Parallel Library, 750
task-parallel scheduling, 759–761, 769 ex.
task scheduling, 446 pr., 816 pr.
tautology, 1060 ex.
Taylor series, 329 pr.
telescoping series, 1143
telescoping sum, 1143
termination of a loop invariant, 20
testing
text, 957
Theta-notation (Θ), 33, 51, 54 fig., 56
thread, 748
Threading Building Blocks, 750
thread parallelism, 748
3-CNF, 1076
3-CNF-SAT, 1076
3-CNF satisfiability, 1076–1079
approximation algorithm for, 1120–1121
and 2-CNF satisfiability, 1043
3-COLOR, 1100 pr.
3-conjunctive normal form, 1076
threshold constant, 77
tight bounds, 56
time, see running time
time domain, 877
time-memory trade-off, 367
T[ i :] (suffix of a text), 986
T[: k] (prefix of a text), 959
to, in pseudocode, 22
top-down method, for dynamic programming, 368
top of a stack, 254
in computing single-source shortest paths in a dag, 616
TOPOLOGICAL-SORT, 573
total order, 1160
total path length, 328 pr.
total preorder, 1160
total relation, 1160
tour
bitonic, 407 pr.
of a graph, 1090
series-parallel composition of, 762 fig.
track in a disk drive, 498
tractability, 1042
trailing pointer, 321
training data, 1003
training phase, 1003
transition function, 967, 973–974
and boolean matrix multiplication, 838 ex.
of dynamic graphs, 667 pr., 669
TRANSITIVE-CLOSURE, 660
transitive relation, 1159
transitivity of asymptotic notation, 61
transpose
conjugate, 838 ex.
of a directed graph, 553 ex.
of a matrix, 1214
transpose symmetry of asymptotic notation, 62
traveling-salesperson problem
approximation algorithm for, 1109–1115
bitonic euclidean, 407 pr.
bottleneck, 1115 ex.
with the triangle inequality, 1110–1113
without the triangle inequality, 1113–1114
traversal of a tree, 314, 320 ex., 1112
treap, 358
AA-trees, 358
binary, see binary tree
bisection of, 1177 pr.
depth-first, 564
diameter of, 563 ex.
dynamic, 478
full walk of, 1112
height-balanced, 357 pr.
height of, 1173
k-neighbor, 358
left-leaning red-black binary search trees, 358
minimum spanning, see minimum spanning tree
optimal binary search, 400–407
parse, 1077
red-black, see red-black tree
scapegoat, 358
search, see search tree
shortest-paths, 608–609, 635–638
spanning, see minimum spanning tree, spanning tree
treap, 358
van Emde Boas, 478
weight-balanced trees, 358
TREE-DELETE, 325, 326 ex., 346–347
TREE-MAXIMUM, 318
TREE-MINIMUM, 318
TREE-PREDECESSOR, 319
TREE-SEARCH, 316
TREE-SUCCESSOR, 319
TRE-QUICKSORT, 202 pr.
trial division, 943
triangle inequality, 1110
triangular matrix, 1216
trichotomy, interval, 490
trichotomy property of real numbers, 62
tridiagonal linear systems, 847 pr.
tridiagonal matrix, 1216
trie (radix tree), 327 pr.
TRIM, 1127
trimming a list, 1126
trivial divisor, 904
tropical semiring, 651 n.
truth table, 1065
TSP, 1091
tuple, 1157
twiddle factor, 891
2-CNF-SAT, 1080 ex.
2-CNF satisfiability, 1080 ex.
and 3-CNF satisfiability, 1043
two-pass method, 529
unary, 1050
unbounded competitive ratio, 804
unbounded linear program, 854
uncle, 340
unconditional branch instruction, 26
unconstrained gradient descent, 1023–1031
uncountable set, 1156
underdetermined system of linear equations, 820
underflow
of a queue, 256
of a stack, 255
undirected graph, 1164
articulation point of, 582 pr.
biconnected component of, 582 pr.
bridge of, 582 pr.
clique in, 1081
coloring of, 1100 pr., 1176 pr.
computing a minimum spanning tree in, 585–603
grid, 697 pr.
hamiltonian, 1056
independent set of, 1099 pr.
nonhamiltonian, 1056
see also graph
undirected version of a directed graph, 1167
uniform family of hash functions, 287
uniform hash function, 278
uniform hashing, 295
uniform probability distribution, 1186–1187
uniform random permutation, 128, 136
of languages, 1052
of linked lists, 264 ex.
of sets (∪ ), 1154
disjoint-set-forest implementation of, 530
linked-list implementation of, 524–526
union by rank, 528
unit (1), 905
unit lower-triangular matrix, 1216
unit upper-triangular matrix, 1216
unit vector, 1215
universal family of hash functions, 286–287
universal hash function, 278
universal hashing, 286–290, 309 pr.
universal sink, 553 ex.
unsorted linked list, 259
unstable matching, 717
unsupervised learning, 1004
until, in pseudocode, 22
unweighted longest simple paths, 385
unweighted shortest paths, 385
upper bound, 54
upper-bound property, 611, 633–634
upper median, 227
upper-triangular matrix, 1216
valid shift, 957
value
of a flow, 672
of a function, 1161
objective, 854
Vandermonde matrix, 881, 1223 pr.
van Emde Boas tree, 478
Var [ ], see variance
variable
decision, 851
in pseudocode, 22
see also indicator random variable
variable-length code, 432
variable-length input
to the wee hash function, 306
variance, 1194
of a binomial distribution, 1200
of a geometric distribution, 1198
convolution of, 880
orthonormal, 849
Venn diagram, 1155
of spanning trees, 603
verification algorithm, 1058
vertex
articulation point, 582 pr.
attributes of, 552
capacity of, 676 ex.
in a graph, 1164
intermediate, 655
isolated, 1165
selector, 1087
VERTEX-COVER, 1084
vertex-cover problem
approximation algorithm for, 1106–1109, 1121–1124
vertex set, 1164
virtual memory, 27
Viterbi algorithm, 411 pr.
walk of a tree, 314, 320 ex., 1112
WAR (wins above replacement), 414 pr.
watershed function, 103
weak duality, 868–869, 874 pr.
weak Pareto optimality, 722 ex.
WEE, 307
weight
of a cut, 1124 ex.
of an edge, 551
mean, 642 pr.
of a shortest path ( δ), 604
of a spanning tree, 585
weight-balanced tree, 358, 472 pr.
WEIGHTED-MAJORITY, 1018, 1022 ex.
weighted median, 244 pr.
weighted set-covering problem, 1132 pr.
weighted-union heuristic, 525

weighted vertex cover, 1121–1124
weight function, 551
well-defined recurrence, 77
while, in pseudocode, 22
white-path theorem, 568
widest augmenting path, 700 pr.
wins above replacement (WAR), 414 pr.
wire, 1065
WITNESS, 946
witness to the compositeness of a number, 946
work, 757
work law, 757
work-stealing scheduling algorithm, 790
worst-case running time, 31
Yen’s improvement to the Bellman-Ford algorithm, 640 pr.
Young tableau, 179 pr.
ℤ (set of integers), 1153
ℤ n (equivalence classes modulo n), 905
(elements of multiplicative group modulo n), 919
(nonzero elements of ℤ n), 944
zero matrix, 1215
zero of a polynomial modulo a prime, 928 ex.
0-1 integer programming, 1098 ex., 1121
0-1 knapsack problem, 428, 430 ex., 1134 pr.
0-1 sorting lemma, 222 pr.
zombie apocalypse, 850