Last updated on July 17, 2016.
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 1Page 25 (Apr. 7, 2016)
#endifas line 56 to the listing at the top of the page.
Chapter 2Page 90 (Apr. 27, 2016)
Exercise 10b: The sample call to
writeBlock( '*', 3, 5)
Page 91 (Apr. 7, 2016)
The data type for
resultis missing in the second line on the page:
int result = mystery(30);
Page 91 (Apr. 27, 2016)
In Exercise 14, add a new-line character to the
coutstatment in the
mainfunction as follows:
std::cout << "The value of f(8) is \n" << f(8) << std::endl;
Chapter 3Page 100 (Apr. 27, 2016)
In line 32 of Listing 3-1, precede
Page 102 (Apr. 27, 2016)
In the method
std::is missing twice as follows:
Interlude 2Page 125 (Apr. 7, 2016)
In Listing C2-2 at the bottom of the page, change the method name
fixedLeakin line 13 to
Chapter 10Page 321 (May 27, 2016)
Revise Exercise 3d by moving the occurrence of n, as follows:
d. Displaying all
Chapter 12Page 371 (Apr. 7, 2016)
The comment in line 60 of Listing 12-1 should end with
Page 389 (May 27, 2016)
In Exercise 1b, we assume that
spherePtrpoints to an instance of
ballPtrpoints to an instance of
Chapter 13Page 412 (May 27, 2016)
In Exercise 13, replace
aQueuein the third and fourth axioms with
Thus, those two axioms should be
(Queue().enqueue(item)).dequeue() ==> Queue()
(Queue().enqueue(item)).peekFront() = item
Chapter 14Page 432 (June 9, 2016)
In the definition of the method
Chapter 15Page 471 (June 9, 2016)
Exercise 6 is the same as Exercise 3a in Chapter 16. Wait until then before solving it.
Page 474 (June 9, 2016)
In the first line on the page, which is part c of Exercise 20, delete the word "formal."
Chapter 16Page 491 (June 9, 2016)
In the third line of the pseudocode at the top of the page, change
curPtr = nodeStack.peek().
Page 511 (June 9, 2016)
Exercise 9: Replace the first sentence with "Trace the nonrecursive inorder traversal algorithm for the binary search tree pictured in Figure 16-4." In the second sentence, delete the word "implicit."
Exercise 11: Change 13 to 14.
Chapter 17Page 524 (Apr. 7, 2016)
Line 5 of Listing 17-2 should be
Chapter 18Page 558 (Apr. 7, 2016)
In the header of the method
addnear the bottom of the page, a comma is misplaced. The code should be as follows:
::add(const KeyType& searchKey,
const ValueType& newValue
Page 584 (July 17, 2016)
Delete the duplicate occurrence of
nextEntryPtrin Line 22 of Listing 18-5.
Chapter 20Page 647 (Apr. 27, 2016)
The third statement in the list of three statements at the beginning of the page should be numbered "3" instead of "2."
Page 661 (July 17, 2016)
The graph in Figure 20-36 is for only Exercise 10.
(End of errata)