
Project 1 1 2/2/2008 6:52:24 PM
Spring 2008: CST 230 Applied Data Structures
Division of Computing Studies
Project 1. Due Date: Feb 15, 2007 5.00 p.m.
Deposit in Blackboard drop box
Linked Lists (Points 100, Weight 8%)
This project involves building your own LinkedList ADT as well as using the one
provided in Java utils package.
1. The following methods should be part of the design and implementation. You
may design this is as a circular list as we will discuss in the class.
a. Insert: prior to a node
b. Add: after a node
c. Equals: true if one list is equal to another
d. Remove: a node with the given element
e. Size: number of elements
f. Print: Print the list
g. Find: find first node in the list with an element starting at given node. Hint
the given node could be NULL.
h. Delete: deletes the list completely
2. Declare your linked list as part of your package such as “cst230_razdan”
3. You will be reading a text file of strings and must implement parsing to accept
following commands. Each command will be a letter such as “i” followed by a
string. Some commands will not have a parameter following it such as “p”.
Commands can be upper or lower case.
a. a Hello: add a node with data “Hello”
b. i Bye: insert a node with data “Bye”
c. R Hello: remove first node with “Hello”
d. S : out put the size of the list
e. F: returns a node with the string passed in as parameter (or NULL),
starting at a given node. If it finds one, then it will set the current node to
this node. So your application needs to maintain a notion of current node.
Insert, Add etc. will then use this to insert before or add after this node.
Find will not be always legal i.e. you may be asked to find a non-existent
node. Your program should return NUL and current node should not
change.
f. P: print the list.
g. D: deletes the list. Any commands after this will start a brand new list as
if you were reading from the top of the file.
4. You will also learn how to use the linked list (not arraylist) in the java.utils
package.
5. Execution of the program: Your program execution should be able to open a file
whose name is prompted by your program or can be supplied as an argument to
your main. You will create one instance of your linked list class and another from