Errata for Algorithms, 4th Edition, Second Printing (January 2012)


CHAPTER 1

p. 30, StdRandom API

Printed: initialize(seed)
Fixed: setSeed(seed)
Reported by Peter Drake, 27-Jan-12.

p. 145, bottom figure

Printed: Node last = new Node()
Fixed: last = new Node()
Reported by Katherine Pogrebniak and Sara Rubin, 16-Feb-12.

p. 237, Problem 1.5.12

Printed: by adding a loop to union() that links every site on the paths from p and q to the roots of their trees to the root of the new tree
Fixed: by adding a loop to find() that links every site on the path from p to the root directly to the root
Reported by Peter Drake, 27-Jan-12.


CHAPTER 2

p. 279, Proposition H

Printed: Number of passes through the array is precisely floor(lg N).
Fixed: Number of passes through the array is precisely ceil(lg N). Delete text referring to 2^n <= N < 2^n+1.
Reported by Ashwin Nanjappa, 10-Jan-11.

p. 333

Printed: public Item min()
Fixed: public Key min()
Reported by Natalie Weires, 11-Jan-12.

p. 334

Printed: Item item
Fixed: Key key
Reported by Abhijith Madhav, 20-Feb-12.

p. 334

Printed: exch(k, N--);
Fixed: exch(qp[k], N--);
Reported by Michael, 22-Feb-12.

p. 335

Printed: top right heap has M and L highlighted in light red
Fixed: E should also be highlighted
Reported by Ashwin Nanjappa, 16-Jan-12.


CHAPTER 3

No errata reported.


CHAPTER 4

p. 592

Printed: KosarajuSharirCC
Fixed: KosarajuSharirSCC
Reported by Noah Apthorpe, 16-Jan-12.

p. 625, Proposition N

Printed: up to E find() and V union() operations
Fixed: up to E connected() and V union() operations
Reported by David Durst, 23-Jan-12.

p. 653

Printed: distTo[3] = 0.97 and edgeTo[3] = 3->7 0.37
Fixed: distTo[3] = 0.99 and edgeTo[3] = 3->7 0.39
Reported by Abhijith Madhav, 22-Feb-12.

p. 673

Printed: q.enqueue(w)
Fixed: queue.enqueue(w)
Reported by Natalie Weires, 11-Jan-12.

p. 749, Proposition K

Printed: A search hit or an insertion in a TST uses a character compare for each character in the search key.
Fixed: In addition to the ~ lg N compares, a search hit or an insertion ...
Reported by Natalie Weires, 10-Jan-11.

p. 764

Printed: M not initialized
Fixed: M = pat.length()
Reported by Natalie Weires, 11-Jan-12.


CHAPTER 5

No errata reported.


CHAPTER 6

p. 896

Printed: return cap - flow;
Fixed: return capacity - flow;
Reported by Noah Apthorpe, 18-Jan-12.