HOMEWORK ASSIGNMENT #3
Assigned Date: Monday,
October 25, 2004
Unit Tests and Javadoc Due: Monday, November 1, 2004
Email to announce teams: Tuesday, November 02, 2004, 5 PM
Complete Project Due: Tuesday, November 9, 2004
Due Time: Noon
Updated: Tuesday, November 02, 2004, 13:15 PM
Thursday, November 04, 2004, 13:00 PM
This assignment focuses on linked data structures and more
See previous assignment.
Develop a sorted linked-list ADT, called LinkedList. This ADT should implement Dale’s ListInterface,
with the following modifications:
- The ADT is robust (not “by contract”).
- Add a getPreviousItem()
method to the interface file.
- Change all occurrences of Listable
(Rationale: This will save you time because the Comparable Java interface
provides a compareTo()
Also all Object ’s have a clone() method which behaves like Dale’s copy() .
There are several Java ADTs that implement Comparable, including Integer,
Double and String; you will be able to use
any one of these in conjunction with your LinkedList
1: Develop the API
documentation (via BlueJ’s javadoc features) for ListInterface.
Develop unit tests that thoroughly “exercise” all special cases for
each operation of the LinkedList
ADT (the latter will not be implemented yet – this comes in part 2). The unit tests should be stored in a
class called LinkedListTest. Develop the API documentation (via
BlueJ’s javadoc features) for LinkedListTest
explaining what (special) case each unit test checks.
2: The LinkedList API should
encapsulate a (sorted) doubly-linked list with dummy head and tail nodes
pointed to by fields head and tail. The list
may contain duplicate values. In the case of duplicates, delete() and retrieve() operate on the
leftmost item. There should not be a numItems (or similar)
variable, i.e., the length of the list will be calculated dynamically
whenever it is needed.
Notes: For this phase you may work by yourself or in a team of two
students. No collaboration
outside your team is allowed, as per course collaboration policy. If you have not sent an email to
announce your team composition by the deadline, you are NOT allowed to
work with a partner.
- Beware of memory leaks (e.g., when deleting items, set all
pointers to null, so that the garbage collector may deallocate all
- Use Java’s assert
statement to test the preconditions of each method, for defensive
- Submit updated javadoc documentation for all your class files
(simply generate Javadoc APIs for each class in BlueJ).
- Apply the 7+|- 2 rule in each module you define. Further modularize where appropriate.
You should submit your source file on a floppy disk, as per
Source filenames to be
A zip archive named <firstName_lastName_fourLastDigitsOfSSN>.hmwk3.zip
(for example, Bill_Manaris_2308.hmwk3.zip). This archive should contain the following
(the BlueJ project directory). Within LinkedList there should be the
(see Widget for a sample)
Any files generated automatically by BlueJ (e.g., bluej.pkg, bluej.pkh, etc.)
subdirectory with the Javadoc API documentation generated by BlueJ, for ListInterface and LinkedListTest.
If you are working with a partner, the name
of the zip archive should contain the names of both partners as follows: <firstName_lastName_fourLastDigitsOfSSN_AND_
firstName_lastName_fourLastDigitsOfSSN>.hmwk3.zip. Ensure that the
documentation is updated appropriately, including the Certificate of