CIS300 Spring 2001: Assignment 8
15 points; due Friday, May 4, at 11:59pm
You may choose one of these three options for your last assignment:
-
Rebuilding the on-line dictionary program so that it stores its words
and definitions in a spelling tree instead of a hash table;
-
Building an application that uses a heap-structure priority queue to
process insertions and removals;
-
Proposing a program of your own design that uses either
a spelling tree or a heap structure to process its inputs.
Option 1: Rebuilding the on-line dictionary with a spelling tree
If you choose this option, you will modify your program from last week
so that the hash table is removed and replaced by a spelling tree.
The program that results must of course handle the same format of input file,
and the User Interface must behave the same way as described in last week's
assignment handout. The program must again be able to save and show
multiple definitions for a word.
If you did good work on last week's assignment, then this option should
be a simple matter of replacing the hash-table class by a spelling-tree
class that has the same interface (method names).
Option 2: Building a priority queue
Computer operating systems use priority queues to handle
multi-tasking (process scheduling)
and input-output requests.
A priority queue behaves as follows:
-
insertion: an object, along with its priority number (an integer)
are enqueued together.
-
retrieval: the object with the top priority (smallest number) is extracted
from the queue and returned. (For this exercise, you need not worry about
the situation when
two objects in the priority queue have the same priority number.)
Here is an example, where strings are inserted with their priority numbers:
insert 8 "abc"
insert 3 "def"
insert 4 "ghi"
retrieve ("def" is returned)
insert 2 "jkl"
retrieve ("jkl" is returned)
insert 5 "mno"
retrieve ("ghi" is returned)
retrieve ("mno" is returned)
At this point, the priority queue still holds "abc", whose low
priority has prevented it from leaving.
The input to the application is a sequence of insert
and retrieve commands. Write a simple GUI that lets the user
do insertions and retrievals. As usual, employ a
Model-View-Controller architecture and strive for a clean, elegant
design and implementation.
Option 3: Proposing your own project
You may devise a problem of your own that uses either a spelling tree
or a priority queue within its Model assembly.
If you choose to do this, you must state your intention to the instructor
at the end of the Friday, April 27, lecture. Then, by Tuesday evening,
May 1, you must send
the instructor an email message that gives your name, your KSU Login ID,
and an approximate 100-200 word description of the project.
You must submit the project at the same deadline as that required for
the other programs.
Submission requirements
Because there are multiple options for this program, your Teaching Assistant
must be told which program you have built. Therefore,
please include a README
file with your other files and packages. The README file
will contain a text description that states which option you have implemented
and how the TA should execute the application you have built.
(Note: if you choose Option 3, include in the README file
the email description of the program you have built.)
Document all classes and package them appropriately. Run javadoc
on your completed program. Place all packages and files in a folder,
Assign8, and use jar to construct and submit
Assign8.jar. Submit
to
http://www.cis.ksu.edu/classes/300/Assign/submit.html.