Last modified Tuesday, 16-Aug-2005 13:59:44 PDT
All errors listed below have been corrected in the third printing (July, 2005). If you have the first or second printing, you will need the errata list for the third printing, as well as the errors listed here. This list will now no longer change. To find out your printing number, look on the copyright page (the back of the title page). There is a list of numbers just below the phrase "Printed in the United States of America" on the lower left. The number on the far left is the number of the printing.4/20/05: Page 501
4/19/05: Page 403 (2nd error)
11/13/04: Page 350
10/16/04: Page 380
5/17/04: Page 399 (3rd error)
4/28/04: Page 158, Page 170 (1st error)
3/19/04: Page 348 (Exercise 8.8)
3/18/04: Page 166
3/17/04: Page 363 (line 12)
2/14/04: Page 30
1/29/04: Page 416
12/18/03: Page 583
11/18/03: Page 170
10/3/03: Page 135, Page 146, Page 151
9/02/03: Page 399 (2nd error)
7/24/03: Page 531, Page 535, Page 537
7/22/03: Page 439
7/18/03: Page 398, Page 399, Page 400, Page 401, Page 402, Page 403, Page 404
7/17/03: Page 348 (Exercise 8.9)
5/27/03: Page 543, Page 637
5/12/03: Page 19 (3 errata), Page 489, Page 491
4/26/03: Page 359, Page 420 (2 errata)
Figure 1.6, line 2: "not (V = 0)" should read "not(V = 0)".
Figure 1.6, line 4: "gcd (V, Y, X)" should read "gcd(V, Y, X)".
Line 3 below Figure 1.6: "a :- b, c, d" should read "a :- b, c, d.".
Exercise 1.7, line 3: "{ if n <= 1) return 1;" should read "{ if (n <= 1) return 1;".
Exercise 2.15(b), last line: "Exercises 2.12 and 2.13" should read "Exercises 2.13 and 2.14".
Line 13: "A context-free language defines a lan-" should read "A context-free grammar defines a lan-".
Figure 5.2: The brackets labeled main, q, and p should
extend to the bottom of the figure. Thus, the figure should appear as
follows:
5th line from the bottom: "92" should read "98".
Figure 5.17: An arrow to the smallest rectangle at the bottom right of the figure is missing. Thus, the figure should appear as follows:
Third line from the bottom: "In the example of Figure
5.22..." should read "In the example of Figure 5.23...".
Figure 5.26, line 5: "instantialtion"
should read "instantiation".
2nd paragraph, first line: "assigment" should read "assignment".
Last line: "... (the same as if one wrote *x = *y in C):" should read "... (the same as if one wrote x = y for pointer variables x and y in C):"
Ada code in the lower middle of the page: The comment in the
third-from-last line of code:
// note use of access attribute to get pointer to square
should read
-- note use of access attribute to get pointer to square
11th line from bottom: "int gti (int x, int y)" should read "bool gti (int x, int y) "
Line 2: "int larger_d = max(3.1,2.9);" should read "double larger_d = max(3.1,2.9);".
Line 10: "integer i;" should read "i: integer; ".
Figure 7.1, line 11: There is a missing closing parenthesis before the semicolon. Thus, "{ printf("%d\n",p(x,f());" should read "{ printf("%d\n",p(x,f()));".
3rd line above Section 7.2.2: " if (p != 0 && p->>data == x)" should read " if (p != 0 && p->data == x)".
Exercise 7.1, line 1: "prefix and postfix and draw the" should read "prefix and postfix form and draw the".
1st Paragraph, line 4 of main code: " p(a[i]);" should read "inc(a[i]);".
Figure 8.5: The return address field (after the access link field) is missing in each of the activation records. Thus, the figure should appear as follows:
Exercise 8.8 (top of page), lines 9 and 10: "a[0] := 1;" and "a[1] := 1;" should read "a[0] = 1;" and "a[1] = 1;", respectively.
Exercise 8.9: The swap procedure is missing two semicolons; the correct code is:
void swap( int x, int y)
{ x = x + y;
y = x - y;
x = x - y;
}
Exercise 8.15(a), line 3: "array[1..n] of integer " should read "integer arrays with the same number of elements".
Exercise 8.16(b), last line: "void p( int x) { int x; ... }" should read "void q( int x) { int x; ... }".
10th line from the bottom:
"(function, imperative, object-oriented)" should read "(functional,
imperative, object-oriented)".
Section 9.1, line 9: "as polar coordinates (r,
)" should read "as polar coordinates (r,θ)".
Line 11: The last word in the line (selectors) should be in
bold face.
Line 12: The statement that the
dequeue operation is a selector is incorrect. In fact, dequeue is a
constructor, which, however, can be written in terms of the other
constructors enqueue and createq, so it behaves as though it were a
selector from the point of view of the axioms. (Such constructors are
called non-primitive. A
further discussion of this issue is beyond the scope of the text.)
Figure 9.11, Line 34: "return q.next;" should read "return q;".
Line 4: "Queue1.frontq q;" should read " - Queue1.frontq q;".
4th and 5th lines from the end of Section
9.7: these lines should not be in code font, and should read:
frontq(enqueue(q,x)) = if emptyq(q) then x else frontq(q)
emptyq(enqueue(q,x)) = false
Middle of page, 4th queue axiom: "if emptyq(q)
then x else front(q)" should read "if emptyq(q)
then x else frontq(q)".
Middle of page, last queue axiom:
Last line should be indented to fall directly under the "if" in the
preceding line.
Next to last line: "dequeue (dequeue
(enqueue (createq, 3), 1))" should read "dequeue (dequeue (enqueue
(createq, 3)))".
Line 12: "if empty(q)" should read "if emptyq(q)".
Lines 12, 14, 15, and 17: "front" should be replaced by
"frontq" (one instance each on lines 12 and 17, two instances each on
lines 14 and 15).
Last line before Exercises: "or front(p) = front(q)"
should read "or frontq(p) = frontq(q)".
Exercise 9.4, line 1: "Figure 9.1" should read "Figure 9.2".
Exercise 9.14, line 5: "lookup:
SymbolTable → name → value" should read "lookup: SymbolTable ×
name → value".
Exercise 9.20, lines 3-5: These lines should read as follows:
(a) frontq(enqueue(enqueue(createq,x), y)) = x
(b) frontq(enqueue(dequeue(enqueue(createq,x)), y)) = y
(c) frontq(dequeue(enqueue(enqueue(createq,x), y))) = y
Exercise 9.22, line 4: "follows:" should read "follows
(in Ada syntax):".
Exercise 9.24, line 7: "maxsize: → integer" should
read "maxsize: integer".
Exercise 9.27: This exercise should be replaced by the following: "Compare the handling of infix operators defined in C++ namespaces to Ada's handling of infix oeprators defined in packages. Are there any significant differences?"
Exercise 9.34, line 4: "create: → Item" should
read "create: Item".
Line 11 (below Fig. 10.2): "statements, z.re == 1.0,
z.im == 1.0,
..." should read "statements, z.re == 1.0,
z.im == 2.0,
...".
10th line from the bottom: " q = d;" should read "d = q;".
5th line from the bottom: "q
= (Deque) d;" should read "d = (Deque) q;".
Lines 5-7: The code
public boolean equals ( Complex c)
{ return re == c.realpart()
&& im == c.imaginary part(); }
should be replaced by the following code
// Must keep Object class definition for overriding:
public boolean equals ( Object obj)
{ Complex c = (Complex) obj;
return re == c.realpart()
&& im == c.imaginarypart(); }
public double area()
/* assumes Rectangle has accessor methods
getWidth and getHeight */
{ return (getWidth()+2*border) * (getHeight()+2*border);
}
↑ (Complex new setReal: ((self realPart) + (y realPart)))
setImag: ((self imagPart) + (y imagPart))
(define (delayed-map f L)
(if (null? L) '()
(delay (cons (f (car (force L)))
(delayed-map f (cdr (force L)))))))
(define L
(delayed-map show (delay (intlist 1 100))))
main()
{ int myid;
/* code to input a,b goes here */
for (myid = 0; myid < NUMPROCS; ++myid)
if (fork() == 0)
{ multiply(myid);
exit(0);
}
for (myid = 0; myid < NUMPROCS; ++myid)
wait(0);
/* code to output c goes here */
return 0;
}