Bill Manaris : Fall 2005 / CSCI 221 Homework 4

Assigned Date: Wednesday, Nov. 16, 2005 (sec 2 +1 day)
Due Date: Thursday, Dec. 1, 2005 (sec 2 +1 day)
Due Time: Noon

Last modified on November 17, 2005, at 03:32 PM (see updates)


This assignment focuses on linked lists.


Implement a TextAnalyzer ADT in Java. This ADT encapsulates a list of items stored using a sorted doubly-linked list with dummy head and tail nodes. The list contains unique words sorted lexicographically (case insensitive) and corresponding counts. Adding a duplicate word simply increments the corresponding count. Deleting a word, decrements the corresponding count. Deleting the last instance of a word, completely removes that word (and corresponding count) from the list.

In terms of implementation, TextAnalyzer objects should have three Node references, head, tail, and currentPosition. There should NOT be a numItems (or similar) variable, i.e., the length of the list will be calculated dynamically whenever it is needed.

Class Node should be implemented as an internal class. It should encapsulate a word and a count, as well as a prev and next link.

TextAnalyzer has the following API:


Here is something extra for bonus points.


Your code should be fully documented via javadoc. Your code should throw approppriate runtime exceptions to test preconditions and handle errors.

Include the following in each class:

       Certification of Authenticity:

       I certify that this submission is entirely my own work, 
       as per course collaboration policy.

       Name: ________________________ Date: ___________


  1. Open your BlueJ project.
  2. Ensure it contains the following: and README.TXT.
  3. Under the Project menu, click Create Jar File... . In the dialog box that opens, select Include Source, and press Continue.
  4. Email the generated .jar file to, by the due date and time.
(Printable View of