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

expected value, 11921194

of a binomial distribution, 1198

of a geometric distribution, 1197

of an indicator random variable, 130

explored edge, 565

exponential function, 6566

exponential search tree, 226, 478

exponentiation

of logarithms, 66

modular, 934–935

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-MAX, 173–174

EXTRACT-MIN, 173

factor, 904

twiddle, 891

factorial function (!), 67–68

factorization, 956

unique, 909

failure, in a Bernoulli trial, 1196

fair coin, 1186

family of hash functions, 286288, 292 ex.

fan-out, 1066

Farkas’s lemma, 869

FASTER-APSP, 653, 655 ex.

fast Fourier transform (FFT), 877902

circuit for, 894–897

multidimensional, 899 pr.

recursive implementation of, 888891

using modular arithmetic, 901 pr.

feasibility problem, 627, 873 pr.

feasible linear program, 854

feasible region, 854

feasible solution, 627, 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, 967–975

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

in recurrences, 116–117

floor instruction, 26

flow, 671–676

aggregate, 864

augmentation of, 678

blocking, 702

cancellation of, 679

integer-valued, 695

net, across a cut, 682

value of, 672

flow conservation, 672

flow network, 671676

corresponding to a bipartite graph, 694

cut of, 682–685

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

forest, 1167, 1169

breadth-first, 728

depth-first, 564

disjoint-set, 527–531

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

forward substitution, 822–823

Fourier transform, see discrete Fourier transform, fast Fourier transform

fractional knapsack problem, 429

fractional matching, 741 pr.

free tree, 1167, 1169–1171

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

for subset sum, 11241130

function, 11611163

Ackermann’s, 544

α-strongly convex, 1041

basis, 841

β-smooth, 1041

boolean, 1182 ex.

convex, 1025–1027, 1194

driving, 101

final-state, 968

hash, see hash function

iterated, 68, 74 pr.

linear, 30, 853

objective, 626, 852, 854

Image 1985

potential, 456

prefix, 975–977

probability distribution, 218 ex.

quadratic, 31

reduction, 1062

suffix, 968

transition, 967, 973–974

watershed, 103

functional iteration, 68

fundamental theorem of linear programming, 872

furthest-in-future, 441

fusion tree, 226, 478

fuzzy sorting, 203 pr.

Gabow’s scaling algorithm for single-source shortest paths, 641 pr.

gadget, 1086, 1097

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

and balls and bins, 143–144

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

golden ratio ( ϕ), 69, 70 ex.

gossiping, 475

gradient descent, 1022–1038

constrained, 1032–1034

in machine learning, 1035–1037

for solving systems of linear equations, 1034–1035

stochastic, 1040 pr.

unconstrained, 1023–1031

GRADIENT-DESCENT, 1025

GRADIENT-DESCENT-CONSTRAINED, 1032

gradient of a function, 1023

GRAFT, 542 pr.

grain size in a parallel algorithm, 783 pr.

graph, 11641169

adjacency-list representation of, 550–551

adjacency-matrix representation of, 551552

and asymptotic notation, 548

attributes of, 548, 552

breadth-first search of, 554–563

coloring of, 1100 pr.

complement of, 1085

component, 576

constraint, 628630

dense, 549

depth-first search of, 563–572

dynamic, 523, 817

ϵ-dense, 668 pr.

hamiltonian, 1056

interval, 425 ex.

matching in, 693–697, 704743

nonhamiltonian, 1056

planar, 584 pr.

regular, 716 ex., 740 pr.

shortest path in, 558

singly connected, 572 ex.

sparse, 549

static, 522

subproblem, 370–371

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.

gray vertex, 554, 564

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

of Huffman codes, 436–437

of offline caching, 442–445

greedy method, 417447

for activity selection, 418–425

for coin changing, 446 pr.

compared with dynamic programming, 384–385, 393 ex., 421, 426–430

Dijkstra’s algorithm, 620–626

elements of, 426431

for the fractional knapsack problem, 429

greedy-choice property in, 427428

for Huffman code, 431–439

Kruskal’s algorithm, 592–594

for maximal bipartite matching, 726

for minimum spanning tree, 591–599

for offline caching, 440–446

optimal substructure in, 428

Prim’s algorithm, 594597

for set cover, 11151119

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.

group, 916923

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 cycle, 1043, 1056

NP completeness of, 1085–1090

hamiltonian graph, 1056

hamiltonian path, 1060 ex., 1098 ex.

HAM-PATH, 1060 ex.

handle, 173

handshaking lemma, 1168 ex.

harmonic number, 1142, 1149

harmonic series, 1142, 1149

HASH-DELETE, 300 ex.

hash function, 275, 282–292

auxiliary, 295

collision-resistant, 941

cryptographic, 291

division method for, 284, 292 ex.

for hierarchical memory, 304–307

multiplication method for, 284286

multiply-shift method for, 285–286

random, 286–290

static, 282, 284286

universal, 286290

wee, 305–307

see also family of hash functions

hashing, 272–311

with chaining, 277–281, 308 pr.

double, 295–297, 301 ex.

independent uniform, 276

with linear probing, 297, 302–304

in memoization, 368, 391

with open addressing, 293–301, 308 pr.

perfect, 310

random, 286–290

to replace adjacency lists, 553 ex.

of static sets, 308 pr.

of strings, 290291, 292 ex.

uniform, 278

universal, 286290, 309 pr.

of variable-length inputs, 290291

of vectors, 290–291

HASH-INSERT, 294, 300 ex.

HASH-SEARCH, 294, 300 ex.

hash table, 275–282

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

heap, 161–181

analyzed by potential method, 459 ex.

building, 167–170, 178 pr.

in constructing Huffman codes, 436

d-ary, 179 pr., 668 pr.

deletion from, 178 ex.

in Dijkstra’s algorithm, 623

extracting the maximum key from, 174

Fibonacci, 478

height of, 163

increasing a key in, 174–175

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

as a priority queue, 172–178

HEAP-DECREASE-KEY, 176 ex.

HEAP-EXTRACT-MIN, 176 ex.

HEAP-MINIMUM, 176 ex.

heap property, 162

maintenance of, 164167

vs. binary-search-tree property, 315 ex.

heapsort, 161–181

lower bound for, 207

HEAPSORT, 170

HEDGE, 1039 pr.

height

black-, 332

of a B-tree, 502–504

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

online, 150152

probabilistic analysis of, 132–133

hit, 965

HOARE-PARTITION, 199 pr.

HOPCROFT-KARP, 709

Hopcroft-Karp algorithm, 709715

HORNER, 47 pr.

Horner’s rule, 46 pr., 879, 963

HUFFMAN, 434

Huffman code, 431–439

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, 1164–1165

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 events, 1188, 1190 ex.

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

Image 1986

independent uniform hashing, 276, 278

independent uniform permutation hashing, 295

indexing into an array, 2223, 26 n., 252

index of an element of , 933

indicator random variable, 130–133

in approximation algorithm for MAX-3-CNF satisfiability, 11201121

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 hashing analysis, 279–281

in the hat-check problem, 134 ex.

in hiring-problem analysis, 132–133

and linearity of expectation, 131

in quicksort analysis, 197198, 200 pr.

in randomized caching analysis, 812

in randomized-selection analysis, 245 pr.

in streak analysis, 148–150

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

distribution of, 128, 134

to a logic gate, 1065

size of, 28

input alphabet, 967

INSERT, 173, 250, 460 ex.

insertion

into binary search trees, 321–322

into B-trees, 506–511

into chained hash tables, 278

into d-ary heaps, 179 pr.

into direct-address tables, 274

into dynamic tables, 461–465

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 red-black trees, 338–346

into stacks, 254

into Young tableaus, 179 pr.

insertion sort, 1721, 2931, 51–53, 5657

in bucket sort, 216218

compared with merge sort, 12–13, 15 ex.

compared with quicksort, 191 ex.

decision tree for, 206 fig.

lower bound for, 52–53

in merge sort, 45 pr.

in quicksort, 198 ex.

using binary search, 45 ex.

INSERTION-SORT, 19, 30, 51

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

interval, 489490, 1157

fuzzy sorting of, 203 pr.

INTERVAL-DELETE, 490, 496 pr.

interval graph, 425 ex.

INTERVAL-INSERT, 490, 496 pr.

INTERVAL-SEARCH, 490, 492

INTERVAL-SEARCH-EXACTLY, 495 ex.

interval tree, 489495

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 function, 68, 74 pr.

iterated logarithm function (lg*), 68

ITERATIVE-TREE-SEARCH, 316

iter function, 536

Java Fork-Join Framework, 750

Jensen’s inequality, 1194

JOHNSON, 666

Johnson’s algorithm, 662–667

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

in a cryptosystem, 936, 939

dummy, 400

median, of a B-tree node, 506

keywords, in pseudocode, 2122, 24

parallel, 750, 752–754, 762–763

Kleene star (*), 1052

k-means problem, 1008

KMP algorithm, 975–985

KMP-MATCHER, 978

knapsack problem

decision version, 1096

fractional, 429

0-1, 428, 430 ex., 1134 pr.

k-neighbor tree, 358

knot, of a spline, 847 pr.

Knuth-Morris-Pratt algorithm, 975985

k-permutation, 136, 1180

Kraft inequality, 1176 ex.

Kruskal’s algorithm, 592–594

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

of a vertex, 724, 742 pr.

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, 803804

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, 393399

Image 1987

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., 803805

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-ROTATE, 336, 495 ex.

left rotation, 335

left shift (⋘), 305

left subtree, 1173

Legendre symbol

, 954 pr.

length

of a cycle, 1165

of a path, 1165

of a sequence, 1162

of a string, 959, 1179

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 constraint, 853854

linear dependence, 1220

linear equality, 853

linear equations

solving modular, 924–928

solving systems of, 819833, 1034–1035

solving tridiagonal systems of, 847 pr.

linear function, 30, 853

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, 297, 302–304

LINEAR-PROBING-HASH-DELETE, 303

linear programming, 850–876, 1121–1124

applications of, 860–866

duality in, 866–873

ellipsoid algorithm for, 857

fundamental theorem of, 872

integer, 857, 874 pr.

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, 626632

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

linked list, 258–264

compact, 269 pr.

deletion from, 261

to implement disjoint sets, 523–527

insertion into, 260

maintained by an online algorithm, 795–802

searching, 260, 292 ex.

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

load instruction, 26, 756

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

parallel, 762765

loop invariant, 1920

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 insertion sort, 1920

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 insertion sort, 5253

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 streaks, 147–148, 153 ex.

on summations, 1148, 1150

for task-parallel computations, 757

for traveling-salesperson tour, 11101113

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., 803805

LU decomposition, 824–827

parallel algorithm for, 784 pr.

LU-DECOMPOSITION, 827

LUP decomposition, 821

computation of, 828–832

in matrix inversion, 833–834

and matrix multiplication, 838 ex.

parallel algorithm for, 784 pr.

use of, 821–824

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.

MARKING, 807, 815 ex.

Markov’s inequality, 1196 ex.

master method for solving a recurrence, 101–107

master recurrence, 101

master theorem, 102

continuous, 112

proof of, 107–115

matched vertex, 693, 705

matching, 704743

bipartite, 693697, 704–743

fractional, 741 pr.

by Hopcroft-Karp algorithm, 709–715

maximal, 705, 1108, 1132 pr.

maximum, 704–716, 1132 pr.

and maximum flow, 693697

perfect, 715 ex., 740 pr.

stable, 716

of strings, 9571002

unstable, 717

matrix, 1214–1226

addition of, 1217

adjacency, 551–552

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., 833837, 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

representation of, 253254

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

Vandermonde, 881, 1223 pr.

matrix-chain multiplication, 373–382

MATRIX-CHAIN-MULTIPLY, 381 ex.

MATRIX-CHAIN-ORDER, 378

matrix multiplication, 80–90, 1218

for all-pairs shortest paths, 648655, 668–669

divide-and-conquer method for, 81–90, 770–775, 783 pr.

and LUP decomposition, 838 ex.

and matrix inversion, 834–837

Pan’s method for, 89 ex.

parallel algorithm for, 770–775, 783 pr.

Strassen’s algorithm for, 85–90, 124125, 773–774

and transitive closure, 838 ex.

MATRIX-MULTIPLY, 81

MATRIX-MULTIPLY-RECURSIVE, 83

matrix-vector multiplication, 762765, 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

building, 167–170

d-ary, 179 pr.

deletion from, 178 ex.

extracting the maximum key from, 174

in heapsort, 170–172

increasing a key in, 174–175

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

maintenance of, 164167

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.

finding, 228–229

in heaps, 174

in red-black trees, 334

MAXIMUM, 173–174, 250

maximum bipartite matching, 693–697, 705–716

maximum flow, 670–703

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.

median, 227–247

weighted, 244 pr.

median key, of a B-tree node, 506

median-of-3 method, 203 pr.

member of a set (∈), 1153

memoization, 368, 390–392

MEMOIZED-CUT-ROD, 369

MEMOIZED-CUT-ROD-AUX, 369

MEMOIZED-MATRIX-CHAIN, 391

memory hierarchy, 27, 301

hash functions for, 304–307

MERGE, 36

mergeable heap, 268 pr.

MERGE-LISTS, 1125

merge sort, 3444, 57

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.

building, 167–170

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

finding, 228–229

offline, 541 pr.

in red-black trees, 334

MINIMUM, 173, 228, 250

minimum-cost circulation, 875 pr.

minimum-cost flow, 862–864

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.

generic method for, 586591

Kruskal’s algorithm for, 592–594

Prim’s algorithm for, 594–597

second-best, 599 pr.

minimum-weight spanning tree, see minimum spanning tree

minimum-weight vertex cover, 11211124

minor of a matrix, 1221

min-priority queue, 173

in constructing Huffman codes, 434

in Dijkstra’s algorithm, 623–624

in Prim’s algorithm, 596597

missing child, 1173

mod, 64, 905

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

modulo, 64, 905

Monge array, 123 pr.

monotone sequence, 181

monotonically decreasing, 63

monotonically increasing, 63

Monty Hall problem, 1210 pr.

MOVE-TO-FRONT, 796797

MST-KRUSKAL, 594

MST-PRIM, 596

MST-REDUCE, 601 pr.

much-greater-than (≫), 533

much-less-than (≪), 761

multicommodity flow, 864–865

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

of a matrix chain, 373–382

matrix-vector, 762765, 767, 1218

modulo nn), 917

of polynomials, 878

multiplication method, 284–286

multiplicative group modulo n, 919

multiplicative inverse, modulo n, 927

multiplicative weights, 10151022

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

keys interpreted as, 283–284

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

residual, 677–681

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

no-path property, 611, 634

normal equation, 843

norm of a vector (∥ ∥), 1219

NOT function (¬), 1065

not a set member (∉ ), 1153

not equivalent (≠ (mod n)), 64

Image 1988

NOT gate, 1065

NP (complexity class), 1043, 1058, 1060 ex.

NPC (complexity class), 1044, 1063

NP-complete, 1044, 1063

NP-completeness, 9–10, 1042–1103

of the circuit-satisfiability problem, 10641071

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, 10851090

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, 10921095

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

numerical stability, 819, 821

n-vector, 1215

o-notation, 60

O-notation, 50, 5455

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

caching, 440446

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

online algorithm, 791–818

for caching, 802–815

for the cow-path problem, 815 pr.

for hiring, 150–152

for maintaining a linked list, 795802

for task scheduling, 816 pr.

for waiting for an elevator, 792794

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, 295297, 301 ex.

with linear probing, 297, 302–304

open interval (( a, b)), 1157

OpenMP, 750

optimal assignment, 723739

optimal binary search tree, 400–407

OPTIMAL-BST, 405

optimal objective value, 854

optimal solution, 854

optimal substructure, 382–387

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 offline caching, 441–442

of rod cutting, 365

of shortest paths, 605–606, 649, 655656

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

OR function (∨), 659, 1065

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

dynamic, 480–486

order-statistic tree, 480486

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

palindrome, 407 pr., 995 ex.

Pan’s method for matrix multiplication, 89 ex.

parallel algorithm, 748790

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 merge sort, 775–782

for merging, 776–780

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.

Strassen’s algorithm, 773774

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

parallel trace, 754–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.

partitioning, 183186

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

augmenting, 681–682, 705

critical, 619

find, 528

hamiltonian, 1060 ex., 1098 ex.

longest, 385, 1042

shortest, see shortest paths

simple, 1165

weight of, 407 pr., 604

PATH, 1045, 1053

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.

permutation, 1163, 11791180

bit-reversal, 897

identity, 138 ex.

in place, 136

Josephus, 496 pr.

k-permutation, 136, 1180

linear, 1224 pr.

random, 136–138

uniform random, 128, 136

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.

PERT chart, 617, 619 ex.

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

polynomial, 65, 877–885

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.

for subset sum, 11241130

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, 255, 449

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

potential method, 456–460

for binary counters, 458–459

for disjoint-set data structures, 534–540, 541 ex.

for dynamic tables, 463–470

for maintaining a linked list, 799801

for min-heaps, 459 ex.

for restructuring red-black trees, 473 pr.

for stack operations, 457–458

potential of a data structure, 456

power

of an element, modulo n, 932936

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

preemption, 446 pr., 816 pr.

prefix

of a sequence, 395

of a string (⊏), 959

prefix computation, 784 pr.

Image 1989

prefix-free code, 432

prefix function, 975–977

prefix-function iteration lemma, 980

preflow, 703

preimage of a matrix, 1224 pr.

preorder, total, 1160

preorder tree walk, 314

Prim’s algorithm, 594597

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, 942953, 956

Miller-Rabin test, 945–953

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.

priority queue, 172–178

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

in Prim’s algorithm, 596597

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 balls and bins, 143–144

of birthday paradox, 140–143

of bucket sort, 216218, 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, 132133, 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, 297300

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, 965966

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.

of streaks, 144–150

of universal hashing, 286290

probabilistic counting, 153 pr.

probability, 11841191

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

computational, 5–6

concrete, 1049

decision, 1045, 1049

intractable, 1042

optimization, 362, 1045, 1049

solution to, 6, 1049

tractable, 1042

procedure, 18

calling, 23, 26, 29 n.

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.

pseudocode, 18, 21–24

pseudoinverse, 843

pseudoprime, 944–945

PSEUDOPRIME, 945

pseudorandom-number generator, 129

P-TRANSPOSE, 770 ex.

public key, 936, 939

public-key cryptosystem, 936942

PUSH, 255, 449

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

queue, 254, 256–257

in breadth-first search, 554

implemented by stacks, 258 ex., 460 ex.

linked-list implementation of, 264 ex.

priority, see priority queue

quicksort, 182204

analysis of, 187–191, 193–198

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 algorithm, 962–967

RABIN-KARP-MATCHER, 966

race condition, 765768

RACE-EXAMPLE, 766

radix sort, 211–215

compared with quicksort, 214

in computing suffix arrays, 992

RADIX-SORT, 213

radix tree, 327 pr.

RAM, 26–27

RANDOM, 129

random-access machine, 26–27

parallel, 789

random hashing, 286–290

randomized algorithm, 128–129, 134–140

and average inputs, 32

comparison sort, 219 pr.

for fuzzy sorting of intervals, 203 pr.

for hiring problem, 135–136

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

for online caching, 807–814

parallel, 789 pr.

for partitioning, 192, 198 ex., 200 pr., 203 pr.

for permuting an array, 136138

and probabilistic analysis, 134136

quicksort, 191–193, 200 pr., 203 pr.

random hashing, 286290

randomized rounding, 1136

for searching a sorted compact list, 269 pr.

for selection, 230–236, 245 pr.

universal hashing, 286290

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 permutation, 136138

uniform, 128, 136

RANDOM-SAMPLE, 139 ex.

RANDOM-SEARCH, 154 pr.

random variable, 1191–1196

indicator, see indicator random variable

range, 1162

of a matrix, 1224 pr.

rank

column, 1220

in computing suffix arrays, 987

full, 1220

of a matrix, 1220, 1224 pr.

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

record, 17, 157

rectangle, 495 ex.

RECTANGULAR-MATRIX-MULTIPLY, 374

recurrence, 39, 76–80, 90–125

Akra-Bazzi, 115119

algorithmic, 77–78

inequalities in, 78

master, 101

solution by Akra-Bazzi method, 117–118

solution by master method, 101107

solution by recursion-tree method, 95–101

solution by substitution method, 90–95

recursion, 34

recursion tree, 42, 95101

in matrix-chain multiplication analysis, 388390

in merge sort analysis, 4244

in proof of continuous master theorem, 108–110

in quicksort analysis, 188190

in rod cutting analysis, 366367

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

red-black properties, 331–332

red-black tree, 331–359

augmentation of, 487489

compared with B-trees, 497, 503

deletion from, 346355

for enumerating keys in a range, 355 ex.

height of, 332

insertion into, 338–346

in interval trees, 490–495

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

properties of, 331335

relaxed, 334 ex.

restructuring, 473 pr.

rotation in, 335–338

searching in, 334

successor in, 334

see also interval tree, order-statistic tree

REDUCE, 784 pr.

reducibility, 1061–1063

reduction algorithm, 1046, 1062

reduction function, 1062

reduction, of an array, 784 pr.

reduction strategies, 10951098

reference, 23

reflexive relation, 1158

reflexivity of asymptotic notation, 61

region, feasible, 854

register, 301, 756

regret, 1016

regular graph, 716 ex., 740 pr.

regularity condition, 103, 112, 114 ex.

regularization, 1012, 1036–1037

reindexing summations, 11431144

reinforcement learning, 1004

rejection

by an algorithm, 1053

by a finite automaton, 968

relation, 11581161

relatively prime, 908

RELAX, 610

relaxation

of an edge, 609611

linear programming, 1122

relaxed red-black tree, 334 ex.

release time, 446 pr., 816 pr.

remainder, 64, 905

remainder instruction, 26

repeated squaring

for all-pairs shortest paths, 652653

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 capacity, 677, 681

residual edge, 678

residual network, 677–681

residue, 64, 905, 954 pr.

respecting a set of edges, 587

return, in pseudocode, 24

return instruction, 26

reweighting

in all-pairs shortest paths, 662664

in single-source shortest paths, 641 pr.

ρ( n)-approximation algorithm, 1104, 1120

RIGHT, 162

Image 1990

right child, 1173

right-conversion, 337 ex.

RIGHT-ROTATE, 336

right rotation, 335

right shift (⋙), 285

right subtree, 1173

rod cutting, 363–373, 393 ex.

root

of a tree, 1171

of unity, 885886

of , 932

rooted tree, 1171

representation of, 265268

rotation, 335338

rounding, 1122

randomized, 1136

row-major order, 253, 396

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

average-case, 32, 128

best-case, 34 ex.

expected, 32, 129

of a graph algorithm, 548

order of growth, 32

parallel, 757758

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

satellite data, 17, 157, 249

satisfiability, 1066, 1073–1079, 11201121, 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, 825, 839

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 B-trees, 504–505

in chained hash tables, 278

in direct-address tables, 274

for an exact interval, 495 ex.

in interval trees, 492–494

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

search tree for, 497519

stacks on, 517 pr.

second-best minimum spanning tree, 599 pr.

secret key, 936, 939

SELECT, 237

used in quicksort, 241 ex.

SELECT3, 247 pr.

selection, 227

of activities, 418–425

and comparison sorts, 241

in order-statistic trees, 481–482

randomized, 230–236, 245 pr.

in worst-case linear time, 236243

selection sort, 33 ex., 53 ex.

selector vertex, 1087

self-loop, 1164

semiconnected graph, 581 ex.

semiring, 651 n., 669

sentinel

in linked lists, 261–264

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

serial projection, 750, 753

series, 11411144

strands logically in, 756

series-parallel composition of parallel traces, 762 fig.

set ({ }), 1153–1158

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, 11151119

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

shortest paths, 604–669

all-pairs, 605, 646669

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 cycles, 607–608

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, 606607, 614–615, 655 ex., 662 ex.

with negative-weight edges, 606607

no-path property of, 611, 634

optimal substructure of, 605–606, 649, 655656

path-relaxation property of, 611, 635

predecessor in ( π), 608

predecessor-subgraph property of, 611, 637–638

problem variants, 605

and relaxation, 609–611

by repeated squaring, 652–653

single-destination, 605

single-pair, 385, 605

single-source, 604645

tree of, 608–609, 635–638

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 cycle, 1165–1166

simple graph, 1166

simple path, 1165

longest, 385, 1042

SIMPLER-RANDOMIZED-SELECT, 243 pr.

simplex, 857

simplex algorithm, 626, 857, 876

simulation, 173, 181

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, 903904, 1049–1052

of a boolean combinational circuit, 1067

of a clique, 1081

of a group, 917

of a set, 1156

of a vertex cover, 1084, 1106

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

feasible, 627, 854

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.

bucket sort, 215219

columnsort, 222 pr.

comparison sort, 205

counting sort, 208211

fuzzy, 203 pr.

heapsort, 161–181

in place, 158, 220 pr.

insertion sort, 12–13, 1721, 5153, 56–57

k-sorting, 221 pr.

lexicographic, 327 pr., 986 n.

in linear time, 208–219, 220 pr.

lower bounds for, 205208, 225

merge sort, 1213, 3444, 57, 775–782

by an oblivious compare-exchange algorithm, 222 pr.

parallel merge sort, 775–782

parallel quicksort, 789 pr.

probabilistic lower bound for, 219 pr.

quicksort, 182–204

radix sort, 211–215

selection sort, 33 ex., 53 ex.

Shell’s sort, 48

stable, 210

table of running times, 159

topological, 573576

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

spawn, in pseudocode, 752–754

spawning, 753

speedup, 758

of a randomized parallel algorithm, 789 pr.

spindle in a disk drive, 498

spine of a string-matching automaton, 970

splay tree, 359, 478

splicing

in a binary search tree, 324325

in a linked list, 260–261

spline, 847 pr.

splitting

of B-tree nodes, 506–508

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, 652653

for raising a number to a power, 934

SRPT (shortest remaining processing time), 816 pr.

stability

numerical, 819, 821

of sorting algorithms, 210

stable-marriage problem, 716–723

stable matching, 716

stable-roommates problem, 723 ex.

stack, 254–255

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, 449451

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 hashing, 282, 284286

static set, 308 pr.

stencil, 787 pr.

Stirling’s approximation, 67

stochastic gradient descent, 1040 pr.

STOOGE-SORT, 202 pr.

store instruction, 26, 756

strand, 754

mutually noninterfering, 767

Strassen’s algorithm, 85–90, 124–125

parallel algorithm for, 773–774

streaks, 144–150, 153 ex.

streaming algorithms, 818

strict Fibonacci heap, 478

strictly decreasing, 63

strictly increasing, 63

string, 957, 1179

interpreted as a key, 290291, 292 ex.

string matching, 9571002

based on repetition factors, 996 pr.

by finite automata, 967–975

with gap characters, 961 ex., 975 ex.

Knuth-Morris-Pratt algorithm for, 975–985

naive algorithm for, 960962

Rabin-Karp algorithm for, 962–967

by suffix arrays, 985996

string-matching automaton, 968–975

strongly connected component, 1166

decomposition into, 576–581

STRONGLY-CONNECTED-COMPONENTS, 577

strongly connected graph, 1166

subarray (:), 19, 23

subgraph, 1166

equality, 724

predecessor, see predecessor subgraph

subgraph-isomorphism problem, 1098 ex.

subgroup, 921923

subpath, 1165

subproblem graph, 370–371

subroutine, 23, 26, 29 n.

subsequence, 394

subset (⊆), 1154, 1156

SUBSET-SUM, 1092

subset-sum problem

approximation algorithm for, 1124–1130

NP-completeness of, 10921095

with unary target, 1098 ex.

substitution method, 90–95

in quicksort analysis, 191 ex., 193–194

and recursion trees, 98

in selection analysis, 240–241

substring, 962, 1179

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

successor

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.

summation, 1140–1152

approximated by integrals, 1150

in asymptotic notation, 58, 1141

bounding, 1145–1152

formulas and properties of, 1140–1145

linearity of, 1141

lower bounds on, 1148, 1150

splitting, 11481149

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

sync, in pseudocode, 752–754

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

tail recursion, 202 pr., 422

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

of primality, 942–953, 956

of pseudoprimality, 944945

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, 10761079

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

timestamp, 564, 571 ex.

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

topological sort, 573576

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.

Euler, 583 pr., 1043

of a graph, 1090

trace, 754–756

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

transitive closure, 659661

and boolean matrix multiplication, 838 ex.

of dynamic graphs, 667 pr., 669

TRANSITIVE-CLOSURE, 660

transitive relation, 1159

transitivity of asymptotic notation, 61

TRANSPLANT, 324, 346

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.

NP-completeness of, 10901092

with the triangle inequality, 1110–1113

without the triangle inequality, 1113–1114

traversal of a tree, 314, 320 ex., 1112

treap, 358

tree, 1169–1176

AA-trees, 358

AVL, 357 pr., 358

binary, see binary tree

bisection of, 1177 pr.

breadth-first, 555, 561

B-trees, 497–519

decision, 206–207, 219 pr.

depth-first, 564

diameter of, 563 ex.

dynamic, 478

free, 1167, 1169–1171

full walk of, 1112

fusion, 226, 478

heap, 161181

height-balanced, 357 pr.

height of, 1173

interval, 489495

k-neighbor, 358

left-leaning red-black binary search trees, 358

minimum spanning, see minimum spanning tree

optimal binary search, 400–407

order-statistic, 480486

parse, 1077

recursion, 42, 95101

red-black, see red-black tree

rooted, 265268, 1171

scapegoat, 358

search, see search tree

shortest-paths, 608–609, 635–638

spanning, see minimum spanning tree, spanning tree

splay, 359, 478

treap, 358

2-3, 358, 519

2-3-4, 502, 518 pr.

van Emde Boas, 478

walk of, 314, 320 ex., 1112

weight-balanced trees, 358

TREE-DELETE, 325, 326 ex., 346–347

tree edge, 561, 564, 569

TREE-INSERT, 321, 338

TREE-MAXIMUM, 318

TREE-MINIMUM, 318

TREE-PREDECESSOR, 319

TREE-SEARCH, 316

TREE-SUCCESSOR, 319

tree walk, 314, 320 ex., 1112

TRE-QUICKSORT, 202 pr.

trial division, 943

triangle inequality, 1110

for shortest paths, 611, 633

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 assignment, 1066, 1073

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

2-3-4 tree, 502, 518 pr.

2-3 tree, 358, 519

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

d-regular, 716 ex., 740 pr.

grid, 697 pr.

hamiltonian, 1056

independent set of, 1099 pr.

matching in, 693–697, 704743

nonhamiltonian, 1056

vertex cover of, 1084, 1106

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, 11861187

uniform random permutation, 128, 136

union

of languages, 1052

of linked lists, 264 ex.

of sets (∪ ), 1154

UNION, 264 ex., 521

disjoint-set-forest implementation of, 530

linked-list implementation of, 524526

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.

universe, 273, 1155

unmatched vertex, 693, 705

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

random, 1191–1196

see also indicator random variable

variable-length code, 432

variable-length input

interpreted as a key, 290291

to the wee hash function, 306

variance, 1194

of a binomial distribution, 1200

of a geometric distribution, 1198

vector, 1215, 12191221

convolution of, 880

interpreted as a key, 290291

orthonormal, 849

Venn diagram, 1155

verification, 1056–1061

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

matched, 693, 705

selector, 1087

unmatched, 693, 705

vertex cover, 1084, 1106

VERTEX-COVER, 1084

vertex-cover problem

approximation algorithm for, 1106–1109, 11211124

NP-completeness of, 10841085

vertex labeling, 724, 742 pr.

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

wee hash function, 305–307

weight

of a cut, 1124 ex.

of an edge, 551

mean, 642 pr.

of a path, 407 pr., 604

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

Image 1991

Image 1992

weighted vertex cover, 1121–1124

weight function, 551

well-defined recurrence, 77

while, in pseudocode, 22

white-path theorem, 568

white vertex, 554, 564

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

X10, 750

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