Project 1: Implementing a Linked List ADT for CST 230 Applied Data Structures, Study Guides, Projects, Research of Data Structures and Algorithms

A project for the cst 230 applied data structures course, where students are required to build their own linkedlist adt and use the one provided in the java utils package. The project involves implementing various methods such as insert, add, equals, remove, size, print, and find. Students will also learn how to use the linked list in the java.utils package and execute the program by opening a file and creating instances of their linked list class and the one from the java.utils package.

Typology: Study Guides, Projects, Research

Pre 2010

Uploaded on 09/02/2009

koofers-user-2rg-1
koofers-user-2rg-1 🇺🇸

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
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
pf2

Partial preview of the text

Download Project 1: Implementing a Linked List ADT for CST 230 Applied Data Structures and more Study Guides, Projects, Research Data Structures and Algorithms in PDF only on Docsity!

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

Project 1 2 2/2/2008 6:52:24 PM

the java.utils package. As you parse the input file, you will perform the same operation on your linked list as well one from the java.utils package.

  1. Output: The last line of the input file will always have the “ p ” command i.e. to print the list. “ p” could appear before the last line as well. You will first print the output from your linked list followed by output from java.utils linked list. Needless to say the two outputs should be the same.
  2. Deliverables: Turn in your java class code and any other supporting code so that I can compile and run in eclipse. Your program should be documented (javadoc) and should be well commented.
  3. Scoring: I will use a test file that your program has not seen before. a. Correctness of the output 75/100 (50 for your list and 25 for Java) b. Documentation and comments 15/ c. Ease of use 10/100. This includes handling errors and arguments (file name), well written code, efficiency, whether it crashes, etc.