Data Abstraction and Problem Solving with C++
Walls & Mirrors
(5th edition)

by

Frank M. Carrano


Connect with me

Join a discussion about teaching and learning computer science   Like us on Facebook   Find me on LinkedIn Follow Frank_M_Carrano on Twitter   Email me

Errata List



Last updated on Februara 26, 2012.
The date after each error is the date it was posted on this list. Subsequent printings of the book will correct these errors.

If you find an error and it is not on this list, please e-mail a description of the error, the page number, and the tile/edition of the book.


Chapter 1


Page 12 (Apr. 15, 2007)
Correct the spelling of "special" in the margin note near the bottom of the page ('e' is missing).


Page 15 (Feb. 26, 2012)
The margin note at the bottom of the page should be "UML syntax for the operations of a class"


Page 52 (Sept. 13, 2006)
Change the last two lines of the comments before the function factorial, as follows:
* @return n * (n - 1) * ... * 1, if n > 0;
*         else 1, if n == 0. */


Page 58 (July 26, 2006)
In the first margin note, change "imcomplete" to "incomplete"

Chapter 2


Page 75 (Aug. 28, 2006)
In the paragraph after the factorial function, delete the indicated words in the following sentence:

"Because the recursive call satisfies fact's precondition, you can expect from the postcondition that fact(n-1) will return the factorial of n - 1."

Page 80 (Dec. 6, 2007)
In the pseudocode for writeBackward and writeBackward2, there is a small discrepancy between the strings in the cout statements and the messages shown in the box traces in Figures 2-8 and 2-9. While the cout statements use wording such as "Enter writeBackward with string: ", the word with is replaced by a comma in the figures.

Page 95 (July 26, 2006)
At the bottom of the page in item #2, "value" should be "value" (monospace italic)


Page 98 (Feb. 23, 2007)
In Figure 2-15b, 4th line of the 2nd and 3rd boxes,
the = should be before the result, not after.


Page 113 (Aug. 28, 2006)
Revise item #3 at the top of the page, as follows:

"When constructing a recursive solution, you should assume that a recursive call's result is correct if its precondition has been met. postcondition is true if its precondition is true."

Chapter 4


Page 191 (July 26, 2006)
In Figure 4-14, change "null" to "NULL"

Online source code (Dec. 20, 2011)
Add the default constructor (defined on page 197) to the file ListP.cpp.

Chapter 6


Page 300 (Apr. 15, 2007)
Insert the word "as" into the last sentence on the page, as follows:
"Therefore, push uses newItem as an alias to its actual argument, and no copy is made."

Page 303 (Oct. 31, 2006)
Delete the lone { in the third from the last line of the copy constructor.

Chapter 7


Page 352 (Oct. 31, 2006)
In the third line from the bottom of the page, "assert" should not be bold; it is not a keyword.


Page 381 (Oct. 31, 2006)
In Exercise 2, the language definition should begin as
L = {w$w' : . . .

In Exercise 3, replace the second and third lines from the end with
aQueue.dequeue(num1)
aQueue.dequeue(num2)


Page 383 (Dec. 6, 2007)
In Exercise 17, delete the "fi" at the end of the two lines
aQueue.isEmpty() = false fi


Chapter 8


Page 390, Figure 8-3 (Dec. 6, 2007)
In the class Sphere, the method getDisplayStatistics should be displayStatistics.
In the class Ball, the label on the arrow pointing to displayStatistics should be "Redefines" instead of "Redefined."

Chapter 9


Page 453 (Sept. 21, 2006)
The graph in Figure 9-3b shows 2^n larger than n^3 for all n. This behavior is not true when n < 10. Instead, 2^n > n^3 when n >= 10.

Chapter 10


Page 517 (Nov. 20, 2006)
In Figure 10-12, the nodes should be labeled 0 through 5 instead of 1 through 6.


Page 523 (June 10, 2008)
In the copy constructor, replace destroyTree(tree.root); with destroyTree(root);


Page 543 (Aug. 11, 2006)
In the pseudocode for insertItem near the bottom of the page, the parameter "newIte" should be "newItem"

Chapter 12


Page 702 (Feb. 26, 2012)
Near the top of the page, the average number of comparisons for an unsuccessful search during linear probling is (1/2)[1 + 1/(1-alpha)^2].The superscript 2 is misplaced.

Appendix A


Page 871 (Aug. 27, 2006)
In the Java examples,
"bool" should be "boolean" 4 times

and

Sphere marbles = new Sphere [SIZE]; should be
Sphere[] marbles = new Sphere [SIZE];

Answers to Self-Test Exercises


Page 949 (Aug. 27, 2006)
In the answer to Question 3 of Appendix A,
"Title" should be "title"

Inside Back Cover


(Dec. 6, 2007)
Delete the "m" at the end of the entry "dynamic_cast checked conversionm"

(End of errata)