This website is preserved for historical and scholarly reference and is no longer actively maintained.
CpSc 210, Section 1
Assignment 4
October 17, 2001
Due: Thursday, Octobver 25 at 11:59 p.m.
Assignment: Extend Bailey's Singly Linked List and write two new methods
for this extended class
Total point value of assignment: 100 points
Not accepted late.
This assignment is to be done INDIVIDUALLY.
Assignment: Design and implement a class, MySingleList as an extension of
Bailey's SinglyLinkedList, which must be stored in a file named
MySingleList.java. (20 point deduction for failure to name file
correctly!) MySingleList.java must contain at least the following methods:
public SinglyLinkedListElement previous (SinglyLinkedListElement current)
// pre: current is not null
// post: returns a reference to the SinglyLinkedListElement that
// precedes current in the list. If head == current or if current
// is not in the list, the null reference will be returned.
public void reverse ( )
// post: the list referenced by this is reversed.
IMPORTANT NOTE: The list reversal is to be accomplished by changing the
references in the SinglyLinkedListElement nodes. You are NOT allowed to
destroy or create new SinglyLinkedListElement nodes.
You may include any additional methods you need. Additional methods
should be private instead of public.
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.
35 pts. works for reverse method
20 pts. works for previous method
15 pts. for your test driver
You will be sent (by email) an outline for this program, which contains
our testDriver. Do not change the main program sent by email except to
add to the end of the main method. The 50 pts. for the specified
testDriver will be based on the test driver sent to you (unchanged).
Thus, any changes/additions you make to the test driver must be appended
to the end of the main method. You will receive credit for every correct
answer for the specified test driver until your program terminates
(except as excluded above).
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).