Name | Last modified | Size | Description | |
---|---|---|---|---|
Parent Directory | - | |||
LinkedListBothTest.java | 2004-03-26 12:17 | 1.5K | ||
LinkedListBothTest.txt | 2004-03-26 12:02 | 413 | ||
LinkedListIntNode.java | 2004-03-26 12:13 | 351 | ||
LinkedListNode-orig.java | 2004-03-26 11:12 | 643 | ||
LinkedListNode.java | 2004-03-26 12:14 | 619 | ||
LinkedListStringNode.java | 2004-03-26 12:13 | 370 | ||
LinkedListTest.java | 2004-03-26 12:16 | 455 | ||
LinkedListTest.txt | 2004-03-26 11:39 | 290 | ||
README.html | 2004-03-26 12:05 | 1.8K | ||
ReadIntegerAndStrings.java | 2004-03-26 12:15 | 1.3K | ||
However each specializes the linked list to be a list of integers or of strings. LinkedListIntNode adds a data field of integer type, and LinkedListStringNode adds a data fields of String type. The basic ability to print a linked list, that is, to step through each element, following next pointers until the next pointer has value null, and at each node calling printNode, is coded in LinkedListNode. Each of LinkedListIntNode and LinkedListStringNode override the printNode method so that it correctly prints the data field, either as an integer or as a string.
Note: there is a new input class, ReadIntegerAndStrings, used in LinkeListBothTest.