First Printing Errata (December 20, 2006)
The titles in Listings 2.1-2.5, should .cpp, not .ccp.
Page 97: Review Question 3.24, change x to monthlyPayment and y to totalPayment.
Page 85: In the diagram before the Tip, change the first ch is 'c' to ch is 'a'.
Page 156: The output for Listing 5.15 should be
x is 1
y is 0
x is 1
y is 1
Page 175: in Exercise 5.8, 105.0 should be 104.0 and 5.44 should be 4.44
Page 176: in Exercise 5.9, 195.721 should be 196.721
Page 178: in Exercise 5.18, 5.2426 should be 4.2426 and 5.4721 should be 4.4721
Page 232: in line 67 of Listing 7.8, change NUMBER_OF_LETTERS to 26
Page 232: in line 71 of Listing 7.8, change 26 to NUMBER_OF_LETTERS
Page 341: in Exercise 10.2, change delete "public static" in two places.
Page 371: in Exercise 11.3, change 3DPoint to ThreeDPoint
Page 448: missing in the Brief Version. Click here to access it.
For the Stack class in Listing 15.6, ImprovedStack.h, the destructor is missing. The destructor should be provided to release the memory for the all the dynamically created data. Here is the destructor:
templateStack ::~Stack() { delete [] elements; }
Page 453: Replace maxValue("ABC", "ABD") line 22 in Listing 15.1 with maxValue(string("ABC"), string("ABD")).
Page 455: in Listing 15.2, line 5, remove the extra T.
For the LinkedList class in Listing 16.2, the destructor is missing. The destructor should be provided to release the memory for the all the dynamically created nodes. Here is the destructor:
template<typename T>
LinkedList<T>::~LinkedList()
{
clear();
}
p521, Example 6 should be replaced by the following code:
For the LinkedList class in Listing 16.2, the destructor is missing. The destructor should be provided to release the memory for the all the dynamically created nodes. Here is the destructor:
if (list.contains(e))
{
cout << e << endl;
}
else
for (int i = 0; i < list.getSize(); i++)
{
cout << list.get(i) << endl;
}
Credits: James Chegwidden (Tarrant County College), Mandy Wright (Altamaha Technical College), Ron McCarty (Penn State), Brian Lawson, Dean Kelly (Minnesota State U.), Caitlin Caldwell (Princeton University), Marcel Manning, the AASU CSCI 2490 class of Spring 2007, the AASU CSCI 2490 class of Fall 2007.
Please send errata to y.daniel.liang@gmail.com. Thanks for helping improve the book!

