CSC 132 Fall 2000

Homework 4

Due: 9 a.m., Thursday 12 October 2000.

30 points

"Double Vision"

 

You will need to download IntDList.java and IDLDriver.java from eccentric download. Your assignment will be to implement a number of IntDList methods as described below. Use IDLDriver.java to test your implementation.

IntDList, like IntList (see Lab 3), stores a list of integers. However, IntDList implements its list as a doubly-linked circular list with a designated header node. Here is a brief explanation:

IntDList also includes a private instance variable called cursor that points to the 'current' node in the list, and provides methods to move the cursor, add elements, remove elements, and calculate the size of the list.

Your assignment is to implement the gotoNext, gotoPrev, add, get, remove and size methods as specified in IntDList.java. Do not add any other methods, and do not change the specifications of any methods. Add javadoc-style comments to the methods that you implement.

Correct output for the supplied driver ('*' indicates cursor position) is:

list = <1, 8, 0, 0, 5, 5, 5, 1, 3, 5, 7, *2001>, size 12
list = <1, 8, 0, 0, 5, 5, 5, 1, 3, 5, *7>, size 11
list = <1, 8, *5, 5, 5, 1, 3, 5, 7>, size 9
list = <1, 8, *7, 8, 5, 5, 5, 1, 3, 5, 7>, size 11
list = <1, *0, 8, 7, 8, 5, 5, 5, 1, 3, 5, 7>, size 12
list = <1, 0, 8, 7, 8, 5, 5, 5, 1, 2, 3, *4>, size 12

 

When finished, submit IntDList.java to your eccentric upload folder. Point breakdown is as before: 5 points documentation, 5 points design and 20 points reliable and correct results.

This assignment is named after a song written and performed by what band? No bonus.


[ Assignments | CSC 132 | Peter Sanderson | Computer Science | SMSU ]


Last reviewed: 4 October 2000

Peter Sanderson ( PeteSanderson@smsu.edu )