School of Engineering and Applied Science
Department of Computer Science
CSci 133 -- Algorithms and Data Structures I
http://www.seas.gwu.edu/~csci133/spring03
Prof. Michael B. Feldman
mfeldman@gwu.edu

Project #4
REVISED - PLEASE THROW AWAY THE EARLIER VERSION!

Due Date: beginning of class, Monday, March 10, 2003

The objective in this project is to develop an ordered linked-list collection class. Each collection will be an alphabetically-sorted list of strings. It is an error to attempt to add two identical strings to the same list; however, the same string can be inserted into several lists. The class will provide these public methods:

  • constructor, toString, and active iteration methods, similar to those in Project 3;
  • boolean insertInOrder(String aString), which inserts a node containing aString in its proper place in the list; insert the node and return true if the insertion was successful (the string was not in the list already) and false otherwise;
  • boolean find(String aString), which returns true if aString is in the list, and false otherwise;
  • boolean delete(String aString), which removes aString from the list and returns true if aString was in the list; returns false if aString was not in the list.
Further, your list system must manage its nodes using a List of Available Space (LAVS). For details, see the article Linked List Node Management Using a List of Available Space (LAVS).

See the article Insertion and Deletion with Ordered Linked Lists for details on the insertion and deletion algorithms.

Test your class with a test program that creates and manipulates at least three list objects.

What to submit:

Follow the guide distributed in lab.