p. 18
| Printed: | String b = 99; |
| Fixed: | String b = "99"; |
p. 38
| Printed: | 10^6 not 100000 but 12 |
| Fixed: | 10^6 not 1000000 but 12 |
p. 44
| Printed: | 49.87 |
| Fixed: | 48.87 |
p. 72, figure
| Printed: | 4th Hello 4th Hello 4th Hello |
| Fixed: | 4th Hello 5th Hello 6th Hello |
p. 73, figure
| Printed: | EightHellos, DivisorsPattern, Newton, Factor |
| Fixed: | TenHellos, DivisorPattern, Sqrt, Factors |
p. 77, Exercise 1.3.2
| Printed: | Program 1.3.3 |
| Fixed: | Program 1.2.3 |
p. 79, Exercise 1.3.17
| Printed: | 1 - f(t) / f'(t) |
| Fixed: | t - f(t) / f'(t) |
p. 84, Exercise 1.3.37
| Printed: |
sin x = -x + x3/3! - x5/5! + ...
cos x = 1 + x2/2! - x4/4! + ... |
| Fixed: |
sin x = x - x3/3! + x5/5! - ...
cos x = 1 - x2/2! + x4/4! - ... |
p. 91
| Printed: | "2", "3", "4", "5", "6", "7", "8", "9", "10" "Jack", Queen", "King", "Ace" |
| Fixed: | "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King", "Ace" |
p. 94, Program 1.4.1
| Printed: | perm[j] = t; |
| Fixed: | perm[i] = t; |
p. 95
| Printed: | the values of N and M are 16 and 5 |
| Fixed: | the values of N and M are 16 and 6 |
p. 100, Program 1.4.3
| Printed: | for (int i = 2; i < N; i++) |
| Fixed: | for (int i = 2; i <=N; i++) |
p. 100
| Printed: | % java PrimeSieve 17 |
| Fixed: | % java PrimeSieve 25 |
p. 104 and p. 106 figures
| Printed: | for (int j = 0; j < N; i++) |
| Fixed: | for (int j = 0; j < N; j++) |
p. 109
| Printed: | if (r < 0.25 && !a[x+1][y]) x++; else if (r < 0.50 && !a[x-1][y]) x--; else if (r < 0.75 && !a[x][y+1]) y++; else if (r < 1.00 && !a[x][y-1]) y--; |
| Fixed: | if (r < 0.25) { if (!a[x+1][y]) x++; } else if (r < 0.50) { if (!a[x-1][y]) x--; } else if (r < 0.75) { if (!a[x][y+1]) y++; } else if (r < 1.00) { if (!a[x][y-1]) y--; } |
p. 113, Exercise 1.4.7
| Printed: | System.out.println(i) |
| Fixed: | System.out.println(a[i]) |
p. 116, Exercise 1.4.20
| Printed: | The value dist[i] |
| Fixed: | The value dist[k] |
p. 149
| Printed: | 4410000/44100 |
| Fixed: | 441000/44100 |
p. 149
| Printed: | void double[] read(String file) |
| Fixed: | double[] read(String file) |
p. 164
| Printed: | multiply outDegree[i][j] by .90 / degree[i] |
| Fixed: | multiply count[i][j] by .90 / outDegree[i] |
p. 165, variable description box
| Printed: | outDegree[j] |
| Fixed: | outDegree[i] |
p. 165
| Printed: | StdOut.println(N + " " N) |
| Fixed: | StdOut.println(N + " " + N) |
p. 171
| Printed: | (.02 * .02) + (.02 + .32) + (.32 * .02) + (.32 * .02) + (.32 * .47) = .17 |
| Fixed: | (.02 * .02) + (.02 + .38) + (.38 * .02) + (.38 * .02) + (.20 * .47) = .12 |
p. 194
| Printed: | Φ(z) = φ(z) (z + z^3/3 + z^5 / 3*5 + z^5 / 3*5*7 |
| Fixed: | Φ(z) = 1/2 + φ(z) (z + z^3/3 + z^5 / 3*5 + z^7 / 3*5*7 |
p. 198
| Printed: | we could change getCoupon() |
| Fixed: | we could change uniform() |
p. 211, Exercise 2.1.16
| Printed: | cos(d2) cos(d) |
| Fixed: | cos(d2) cos(d1) |
p. 226
| Printed: | See Exercise 2.1.17 |
| Fixed: | See Exercise 2.1.28 |
p. 227
| Printed: | the integers in the second column |
| Fixed: | the numbers in the second column |
p. 237
| Printed: | java StdStatistics< tiny.txt |
| Fixed: | java StdStats< tiny.txt |
p. 238
| Printed: | plotPoints(), plotLine() , and plotBars() |
| Fixed: | plotPoints(), plotLines(), and plotBars() |
p. 243
| Printed: | Bernoulli Program (2.2.5) |
| Fixed: | Bernoulli Program (2.2.6) |
p. 260
| Printed: | is the same as the gcd of p and p % q |
| Fixed: | is the same as the gcd of q and p % q |
p. 260, figure
| Printed: | |
| Fixed: | gcd(192, 24) missing from figure |
p. 263, figure
| Printed: | Seventh line: moves(1,true) |
| Fixed: | moves(1,false) |
p. 269, figure
| Printed: | sz point to half the length of a side of an H |
| Fixed: | sz should be the full length of a side of an H |
p. 272
| Printed: | When 0 < H < 1/2 the displacements tend to decrease When 2 > H > 1/2 displacements tend to increase |
| Fixed: | When 0 < H < 1/2 the displacements tend to increase When 2 > H > 1/2 the displacements tend to decrease |
p. 273
| Printed: | not smaller the original |
| Fixed: | not smaller than the original |
p. 277
| Printed: | Are there situations when iteration |
| Fixed: | Are there situations when recursion |
p. 278
| Printed: | public static int ex233(int n) |
| Fixed: | public static void ex233(int n) |
p. 321, Figure
| Printed: | c.potentialAt(x, y) |
| Fixed: | c1.potentialAt(x, y) |
p. 350, Program 3.1.11
| Printed: | // Split file by column into M+1 files. |
| Fixed: | // Split file by column into N files. |
p. 362, Program 3.1.1
| Printed: | Value of charges not specified. |
| Fixed: | Assume value of charges is 1.0 for each Charge. |
p. 368, Exercise 3.1.38
| Printed: | wrong rotation formula |
| Fixed: | ti = (si - ci) cos(theta) - (sj - cj) sin(theta) + ci tj = (si - ci) sin(theta) + (sj - cj) cos(theta) + cj |
p. 372, figure
| Printed: | public class Charge () |
| Fixed: | public class Charge |
p. 379
| Printed: | Program 3.2.2 |
| Fixed: | Add trailing } to main() |
p. 380
| Printed: | Its private draw() method scales |
| Fixed: | Its draw() method scales |
p. 381
| Printed: | Program 3.2.3 |
| Fixed: | Better style: remove call to draw() in addDataPoint(). |
p. 381, Program 3.2.3
| Printed: | private void draw() |
| Fixed: | public void draw() |
p. 383
| Printed: | adds the step size times the sine ... step size times the cosine |
| Fixed: | adds the step size times the cosine ... step size times the sine |
p. 385
| Printed: | turn right 60 degrees (left -120 degrees) |
| Fixed: | turn right 120 degrees (left -120 degrees) |
p. 421
| Printed: | theta = atan(re / im) |
| Fixed: | theta = Math.atan2(im, re) |
p. 421
| Printed: | b.im |
| Fixed: | b.im() |
p. 434
| Printed: | if a is less than b, then b must be less than a |
| Fixed: | if a is less than b, then b must be greater than a |
p. 436
| Printed: | public Counter implements |
| Fixed: | public class Counter implements |
p. 437
| Printed: | "integrate(Gaussian.phi(), a, b) |
| Fixed: | "integrate(Gaussian.phi(), a, b, N) |
p. 443
| Printed: | (x0-y0)^2 + (x0-y0)^2 + ... |
| Fixed: | (x0-y0)^2 + (x1-y1)^2 + ... |
p. 451, Exercise 3.3.12
| Printed: | two-dimensional vectors |
| Fixed: | two-dimensional unit vectors |
p. 457
| Printed: | Vector (Program 3.3.4) |
| Fixed: | Vector (Program 3.3.3) |
p. 458
| Printed: | Body (Program 3.4.5) |
| Fixed: | Vector (Program 3.4.1) |
p. 431
| Printed: | As with Complex paragraph |
| Fixed: | rewrite to correct grammar |
p. 434
| Printed: | if a is less than b, then b must be less than a |
| Fixed: | if a is less than b, then b must be greater than a |
p. 485, table
| Printed: | logarithmic 1000 |
| Fixed: | remove row corrresponding to logarithmic |
p. 490-491
| Printed: | Charge object uses 20 bytes and Complex object uses 16 bytes |
| Fixed: | Charge objects uses 32 bytes and Complex object uses 24 bytes |
p. 493, table
| Printed: | 8N^2 + 20N + 16 and 16N^2 + 20N + 16 |
| Fixed: | 4N^2 + 20N + 16 and 8N^2 + 20N + 16 |
p. 501, Exercise 4.1.10
| Printed: | 5 seconds, 20 seconds, 45 seconds, 80 seconds, 125 seconds |
| Fixed: | 5 seconds, 20 seconds, 45 seconds, 80 seconds |
p. 515, Program 4.2.2
| Printed: | void (twice) |
| Fixed: | double |
p. 515, Program 4.2.2
| Printed: | m (twice) |
| Fixed: | mid |
p. 515
| Printed: | Test whether Φ(m) < y |
| Fixed: | Test whether Φ(m) > y |
p. 527, mergesort trace
| Printed: | was was but but was was was but |
| Fixed: | was was was was was was was was |
| Printed: | % java Mergesort 8 |
| Fixed: | % java Mergesort < tiny.txt |
p. 563
| Printed: | if (N == a.length/4) resize(a.length/2); |
| Fixed: | if (N > 0 && N == a.length/4) resize(a.length/2); |
p. 587
| Printed: | iterate from i = 0 to N-1 (FIFO order) private int i = 0; public boolean hasNext() { return i < N; } public Item next() { return a[i++]; } |
| Fixed: | iterate from i = N-1 to 0 (LIFO order) private int i = N; public boolean hasNext() { return i > 0; } public Item next() { return a[--i]; } |
pp. 622, 623, 624, 626
| Printed: | of appears before it alphabetically |
| Fixed: | replace of with if |
p. 624
| Printed: | if the search ley is less, we set the right link |
| Fixed: | if the search ley is greater, we set the right link |
p. 633
| Printed: | the item type should implement the Comparable interface |
| Fixed: | the key type should implement the Comparable interface |
p. 635
| Printed: | ST on the booksite uses java.util.TreeSet |
| Fixed: | SET on the booksite uses java.util.TreeSet |
p. 665, Program 4.5.3
| Printed: | delimeter |
| Fixed: | delimiter |