Errata for Algorithms, 4th Edition, Fifth Printing (June 2014)
CHAPTER 1
p. 19
Printed: | ArrayOutOfBoundsException |
Fixed: | ArrayIndexOutOfBoundsException |
p. 46
Printed: | 84 48 68 10 18 98 12 23 54 57 48 33 16 77 11 29 |
Fixed: | 84 48 68 10 18 98 12 23 54 57 33 16 77 11 29 |
p. 118, Exercise 1.2.18
Printed: | The solution does not properly implement the one-pass algorithm. |
Fixed: | See Accumulator.java. |
p. 202
Printed: | a String object of length N typically uses 40 bytes for the String object |
Fixed: | a String object of length N typically uses 32 bytes for the String object |
CHAPTER 2
No errata reported at this time.
CHAPTER 3
p. 407
Printed: | min() throws java.lang.NullPointerException if symbol table is empty |
Fixed: | should return null or throw a java.util.NoSuchElementException |
p. 409
Printed: | select() throws java.lang.NullPointerException if k is invalid index |
Fixed: | should return null or throw a java.util.NoSuchElementException |
p. 453, 455 (Exercise 3.3.39 and 3.3.40)
Printed: | moveRedLeft() and moveRedRight() |
Fixed: | Need extra call to flipColors(h) as last line in if statements |
p. 474
Printed: | call resize(2*M) when N >= M/2 and resize(M/2) when (N >= 0 && N <= M/8) |
Fixed: | call resize(2*M) when N >= 8*M and resize(M/2) when (N >= 0 && N <= 2*M) |
CHAPTER 4
p. 529
Printed: | wt[find[v]] |
Fixed: | sz[find[v]] |
p. 573
Printed: | The "potentially accessible objects" point to the gray nodes |
Fixed: | The "potentially accessible objects" should point to the white nodes |
p. 621
Printed: | second figure: 4 0-4 0.38 |
Fixed: | second figure: 4 4-7 0.37 |
p. 653
Printed: | figure: distTo[6] is 1.49 |
Fixed: | it should be 1.51 |
p. 656
Printed: | using time and space proportional to E V log V |
Fixed: | using time proportional to E V log V and space proportional to V^2 |
p. 675
Printed: | |
Fixed: |
Add to third bullet: Then relax 7->5, 5->4 and 5->7, which are ineligible.
Add to fifth bullet: Then relax 6->0 and 6->2, which are ineligible. |
CHAPTER 5
p. 736
Printed: | cnt += size(next[c]); |
Fixed: | cnt += size(x.next[c]); |
p. 763
Printed: | they are the first j-1 characters in the pattern |
Fixed: | they are the first j-1 characters in the pattern starting at index 1 |
p. 771
Printed: | If the string character causing the mismatch does appear in the pattern |
Fixed: | If the string character causing the mismatch does not appear in the pattern |
CHAPTER 6
p. 883
Printed: | private Suffix(String s, int index) |
Fixed: | private Suffix(String text, int index) |
p. 889
Printed: | private boolean isFeasible(FlowNetwork G) |
Fixed: | private boolean isFeasible(FlowNetwork G, int s, int t) |