Errata for Algorithms, 4th Edition, Second Printing (January 2012)
CHAPTER 1
p. 30, StdRandom API
| Printed: | initialize(seed) |
| Fixed: | setSeed(seed) |
p. 145, bottom figure
| Printed: | Node last = new Node() |
| Fixed: | last = new Node() |
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 |
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. |
p. 333
| Printed: | public Item min() |
| Fixed: | public Key min() |
p. 334
| Printed: | Item item |
| Fixed: | Key key |
p. 334
| Printed: | exch(k, N--); |
| Fixed: | exch(qp[k], N--); |
p. 335
| Printed: | top right heap has M and L highlighted in light red |
| Fixed: | E should also be highlighted |
CHAPTER 3
No errata reported.
CHAPTER 4
p. 592
| Printed: | KosarajuSharirCC |
| Fixed: | KosarajuSharirSCC |
p. 625, Proposition N
| Printed: | up to E find() and V union() operations |
| Fixed: | up to E connected() and V union() operations |
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 |
p. 673
| Printed: | q.enqueue(w) |
| Fixed: | queue.enqueue(w) |
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 ... |
p. 764
| Printed: | M not initialized |
| Fixed: | M = pat.length() |
CHAPTER 5
No errata reported.
CHAPTER 6
p. 896
| Printed: | return cap - flow; |
| Fixed: | return capacity - flow; |