Data Structures and Abstractions with Java
(3rd 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 April 23, 2014.
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.


Inside Front Cover


Step 2 (May 24, 2013)
Click on Premium Content, not Companion Website.


Chapter 1


Page 8 (May 24, 2013)
The footnote should refer to Appendix B, not C.


Chapter 2


Page 35 (July 24, 2013)
Figure 2-4 is incorrect. The correct figure is



Page 57 (Sep. 6, 2011)
Exercise 10: Change the return type of the method getAllLessThan to BagInterface. Although you could use a return type of ArrayBag, you shouldn't do so in the interface BagInterface, since interfaces should not reflect implementation details.

Page 59 (June 27, 2013)
In the answer to Self-Test Question 8, the last line should be

The bag contains the following string(s):


Chapter 3


Page 77 (Sep. 6, 2011)
In the definition of the method remove, replace the statement
remove(); // remove first node
with
firstNode = firstNode.next;
numberOfEntries--;


Although the method works correctly as is, it depends on knowing that remove() removes the first node in the chain. When a method M calls another method N, M should assume only what N specifies that it will do. M should not depend on the details of N's implementation.

Page 83 (Sep. 6, 2011)
In the 7th line of code at the top of the page (for Exercise 2), replace String with Object:
Object[] entries = myBag.toArray();

Exercise 7: Add a period at the end of the sentence.


Chapter 4


Page 106 (Mar. 29, 2013)
In Exercise 11, counter should begin at 1 instead of 0.


Chapter 10


Page 271 (Oct. 14, 2011)
Project 3: In the last sentence, change "bag or stack" to "vector."


Chapter 11


Page 303 (Oct. 14, 2011)
Project 16: Move the last sentence in Part b to the end of Part a.


Chapter 12


Page 307 (Mar. 25, 2013)
The heading at the top of page should be "Abstract Data Type: List," instead of "Abstract Data Type: Queue"

Page 307 (Mar. 16, 2014)
In the UML for the remove method, replace T with void


Chapter 13


Page 334 (Oct. 14, 2011)
Segment 13.20: Delete the semicolon at the end of the Java statement @SuppressWarnings("unchecked"). Note that the two quotes should be straight, not curly.

Page 336 (Jan. 10, 2012)
Exercise 4: In the last sentence, change "implemention" to "implementation"

Page 337 (Oct. 14, 2011)
Project 10: Change "Implement the ADT bid" to "Implement the collection of bids"


Chapter 14


Page 340 (Nov. 6, 2013)
In the first sentence of the third paragraph, the reference to Chapter 2 should be Chapter 3.

Page 348 (Mar. 16, 2014)
In the second line from the end of the first paragraph, "5initializes" should be "initializes."

Page 348 (Nov. 6, 2013)
In the first sentence of the second paragraph, "cnalls" should be "calls."

Page 363 (Apr. 8, 2014)
In the Chapter Summary,

Revise the first bullet as follows:
• When a chain has only a head reference or has both head and tail references, the following are true:

Revise the second sub-bullet of the second bullet as follows:
• Adding a node to the chain’s end is a special case, but does not require a traversal.


Chapter 16


Page 431 (Nov. 26, 2011)
In Exercise 5, end the second sentence after "ADT." That is, the second sentence should be "Implement such an ADT."


Chapter 17


Page 441 (Oct. 14, 2011)
In Listing 17-2 at the bottom of the page, insert a semicolon at the end of the line
private int numberOfEntries;

Page 442 (Oct. 14, 2011)
In the definition of the protected class Node (continutation of Listing 17-2), the comment
// next to next node
should be
// link to next node


Chapter 20


Page 516 (Oct. 14, 2011)
Near the bottom of the listing of the class SortedLinkedDictionary, the reference to Segment 20.26 should be to Segment 20.25.

Page 520 (Nov. 26, 2011)
In Exercise 13, revise the third sentence as follows: "Represent the glossary as a collection an array of 26 sorted lists, one . . ."



Chapter 21


Page 544 (Mar. 16, 2014)
In Exercise 3, the reference to Project 11 should be to Project 10.


Chapter 24


Page 616 (Apr. 8, 2014)
At the end of the page, "Listing 24-3" should be "Listing 24-4."

Page 619 (Apr. 23, 2014)
Segment 24.17, second paragraph second line: The sentence ends: "as shown in Listing 24-4." It should read: "as shown in Listing 24-5."

Segment 24.18: The last line now reads: "appears in Listing 24-5." It should read: "appears in Listing 24-6."

Page 621 (Nov. 26, 2011)
In Listing 24-7, replace the declaration of the method getChildrenIterator with
public Iterator<GeneralNodeInterface<T>> getChildrenIterator();
That is, replace the T with GeneralNodeInterface<T>

Page 624 (Jan. 10, 2012)
Exercise 2: Delete "not" in the last sentence ("That is, getNumberOfNodes should not call a private method."

Page 626 (Nov. 26, 2011)
Project 6: Delete the second sentence and replace the third sentence with "Write the class GeneralTree that implements GeneralTreeInterface."



Chapter 27


Page 727 (Nov. 26, 2011)
Project 10: The last bulleted item should not be bulleted. That sentence does not describe one of the required operations. Rather, it describes what you should do.



Chapter 29


Page 771 (Jan. 10, 2012)
Segment 29.15: Begin the else clause with the following two statements:

// the cast is safe within this else clause
@SuppressWarnings("unchecked")

Page 780 (Jan. 10, 2012)
Exercise 18: Remove the number "19" beside Figure 29-6. There is no Exercise 19.



Chapter 30


Page 30-17 (Mar. 16, 2014)
At the bottom of the page, the class Node should be private instead of public.

Page 30-23 (Jan. 10, 2012)
Exercsie 1: Change "Is the class Student . . . " to "Are objects of the class Student . . . "



Appendix F


Page F-5 (Nov. 26, 2011)
In the first line of code in Segment F.8, counter ++ should be counter++



Index


Page I-9 (Mar. 25, 2013)
The entry for the toString method should be

toString method, B-17, C-18



(End of errata)