Data Structures Project 2 - Spring 2000

Due: Friday, Mar 17, 2000, 5:00 pm by e-mail.

In this project, you will construct an implementation of the entire Sequence interface using either an array or linked list. In particular, if your student number (SSN) ends in an odd digit, you must use an array, and if your student number ends in an even digit, you must use a doubly-linked list.

You will also create a MyTextEditor class, which uses your sequence to implement the SimpleTextEditor interface. Your text editor should process strings. To demonstrate your text editor you need to create a main() method that performs the following actions:

  1. Initialize the text to be the same as the file, Initial.txt, which is provided for your benefit.
  2. Print the text.
  3. Use each and every method in the SimpleTextEditor interface (except print()) to convert the initial text into the text, Middle.txt, which is also provided for your benefit.
  4. Print the text.
  5. Use as many additional methods in the SimpleTextEditor interface as needed to convert this text into the text, Final.txt, which is also provided for your benefit.
  6. Print the text.

The following files can be used by you to study or borrow:

So, to sum up, you need to do the following:

  1. Write a class, ArraySequence or LinkedSequence, which implements the Sequence interface using either an array or linked list (depending on your SSN).
  2. Write a class, ArrayPosition or NodePosition, which implements the Position interface in a manner consistent with your ArraySequence or LinkedSequence class.
  3. Write your MyTextEditor.java class, which includes a main() method performing the required demonstration.