This website is preserved for historical and scholarly reference and is no longer actively maintained.
CpSc 210, Section 1
Assignment 5
October 23, 2001
Due: Thursday, November 1 at 11:59 p.m.
Assignment: Extend Bailey's Singly Linked List to include a tail reference
Total point value of assignment: 100 points
Not accepted late.
This assignment is to be done INDIVIDUALLY.
Assignment: Design and implement a class, ListWithTail as an extension of
Bailey's SinglyLinkedList, which must be stored in a file named
ListWithTail.java. (20 point deduction for failure to name file
correctly!)
The List interface is given on pages 99-100 of Java Structures. Your
program should include each method in the order in which the methods
are listed in the interface. If the method in SinglyLinkedList can be
used without any changes, your code listing should include the method
as a comment:
// public Iterator elements(); is supplied by the super class
Otherwise, the required method should be coded. If you wish to call
the method in the super class as part of your code, you can do this
using "super." as a prefix. For example, if my code needs to execute
addToHead for the super class, it would be coded:
public void addToHead ( Object value )
// ...
{
super.addToHead ( value );
...
}
You should make use of the code supplied by the super class whenever
doing so does not adversely affect the efficiency of your code.
A method will be marked incorrect if the efficiency is not best possible.
Since we have not covered the elements() method, you should assume
that this method is supplied by the super class. (Also, your
test driver does not need to test the elements() method.)
Grading Rubric:
10 pts. reasonable attempt to solve problem as assigned
10 pts. also compiles
10 pts. style standards (includes clarity)
The following 70 points are available only for code that compiles
and runs without error. Some considerations are:
comments showing methods not changed
code works correctly
appropriate reuse of code of super class
Other requirements:
The first operation of your main program must be to print "CPSC 210", your name, the assignment number, and a brief description of the assignment.
Follow the style standards to be found on your instructor's
web page for CPSC 210.
Submit your program using the handin command. There is a link to
the handin description on the CPSC 210 lab page (www.cs.clemson.edu/~lab210).