Errata, Chapter 4


p. 431

Printed: As with Complex paragraph
Fixed: rewrite to correct grammar
Reported by Barry Dewitt, 26-Jun-08.

p. 485, table

Printed: logarithmic 1000
Fixed: remove row corrresponding to logarithmic
Reported by Michelle Lu, 19-Oct-07.

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
Reported by Donna Gabai, 06-Oct-07.

p. 493, table

Printed: 8N^2 + 20N + 16 and 16N^2 + 20N + 16
Fixed: 4N^2 + 20N + 16 and 8N^2 + 20N + 16
Reported by Donna Gabai, 11-Oct-07.

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
Reported by Donna Gabai, 06-Oct-07.

p. 515, Program 4.2.2

Printed: void (twice)
Fixed: double
Reported by Kevin Wayne, 20-Nov-07.

p. 515, Program 4.2.2

Printed: m (twice)
Fixed: mid
Reported by Kevin Wayne, 20-Nov-07.

p. 515

Printed: Test whether Φ(m) < y
Fixed: Test whether Φ(m) > y
Reported by Kareem Elnahal, 19-Oct-07.

p. 527, mergesort trace

Printed: was was but but was was was but
Fixed: was was was was was was was was
Reported by Donna Gabai, 31-Mar-08.

p. 563

Printed: if (N == a.length/4) resize(a.length/2);
Fixed: if (N > 0 && N == a.length/4) resize(a.length/2);
Reported by Kevin Wayne, 13-Feb-08.

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]; }
Reported by Kareem Elnahal, 26-Nov-07.

pp. 622, 623, 624, 626

Printed: of appears before it alphabetically
Fixed: replace of with if
Reported by Greg Humpreys, 31-Oct-07.

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
Reported by Robert Zahler, 01-Dec-07.

p. 635

Printed: ST on the booksite uses java.util.TreeSet
Fixed: SET on the booksite uses java.util.TreeSet
Reported by Robert Zahler, 01-Dec-07.

p. 665, Program 4.5.3

Printed: delimeter
Fixed: delimiter
Reported by Seth Priebatsch, 25-Nov-07.