Programming Assignment 1
Creating a Cache of Glossary Words
Due ______________
You will be adding new classes to the
glossarier package.
Each new class should start with
package glossarier;
You will use an unsorted linked list
to cache all the words in a web page. The
words will be collected using glossarier.Main and glossarier.WordFinder.
You will write a new implementation of Glossary Creator that puts the
words passed to GlossaryCreator.alreadyThere into a
linked list. The NAME string of this GlossaryCreator should be “unsorted”. If the word is in the list already there will
return true. Otherwise it returns false
and puts the new word at the end of the list.
GlossaryCreator.comparisons will return how
many comparisons you did on the last call of already there. GlossaryCreator.totalComparisons
returns how many comparions your GlossaryCreator
has done. GlossaryCreator.largestComparison
returns the maximal value of GlossaryCreator.comparisons(). GlossaryCreator.work will return a string like that in TrivialCreator.work(). You can use a
linked list type from your CS2 (CMP211) class or write one specially
for this assignment.
Your new implementation of GlossaryCreator will replace the TrivialCreator
in glossarier.Main.
When it is run on a test web page each word should be defined only once
and in the order they appear in the web page.
The amount of work from each of the searches should be in a table below
the definitions.
The grading system will be as
follows:
Style 30% (comments, indenting and names)
Design 40% (good code, good organization)
Success 30% (does it compile, does it run without
bugs)
Extra credit: remove
plural and tense suffixes from words before searching. Improved formatting of
definitions and work tables.
Programming Assignment 2
Searching Sorted and Unsorted Cache of Glossary Words
Due ________________
You need to have a correct version of
project 1 to do project 2 so first fix all problems in project 1. Unless you do that you are not likely to get
more than 40% (of 100) in project 2.
In project 2 you will add a second GlossaryCreator to the creators array in glossarier.Main. The
second creator will insert the words into a linked list in sorted order. The NAME string of this GlossaryCreator
should be sorted. Otherwise the new
Glossary Creator will behave exactly like the unsorted glossary creator in project
1.
When a web page is selected by the
user the work from both the unsorted and sorted glossary creators should be in
a table on the bottom of the glossaried page.
The grading system will be as
follows:
Style 30% (comments, indenting and names)
Design 40% (good code, good organization)
Success 30% (does it compile, does it run without
bugs)
Programming
Assignment 3
Hash Tables for Glossary Words
Due ________________
You need to have a correct version of
project 2 to do project 3 so first fix all problems in project 2. Unless you do that you are not likely to get
more than 40% (of 100) in project 3.
In project 3 you will add a third GlossaryCreator to the creators array in glossarier.Main. The
third creator will insert the words into a hash table. The NAME string of this GlossaryCreator
should be hash. You should get the hash
table size from the user when the program is run. Your hash table should use a good hashing
function.
You will change the work method of
all three creators you are using to report the average number of comparisons
instead of the total number of comparisons.
The average is the total number of comparisons divided by the number of
words passed to alreadyThere (not the number of words
in the list since the same word can be passed multiple times).
When a web page is selected by the
user the work from the unsorted, sorted and hash glossary creators should be in
a table on the bottom of the glossaried page.
The grading system will be as
follows:
Style 30% (comments,
indenting and names)
Design 40% (good code, good organization)
Success 30% (does it compile, does it run without
bugs)
Programming
Assignment 4
Priority Queue Cache of Glossary Words
Due ________________
You need to have a correct version of
project 3 to do project 4 so first fix all problems in project 3. Unless you do that you are not likely to get
more than 40% (of 100) in project 4.
In project 4 you will add a fourth GlossaryCreator to the creators array in glossarier.Main. The
fourth creator will insert the words into a priority queue, implemented as an
array. Every word will start in the
queue with priority 0. If the word is
passed to alreadyThere again its priority will be
increased and the order of words in the array will be changed if
necessary. The NAME string of this GlossaryCreator should be priority. Otherwise the new Glossary Creator will
behave exactly like the unsorted glossary creator in project 1.
When a web page is selected by the
user the work from both the unsorted and sorted glossary creators should be in
a table on the bottom of the glossaried page.
The grading system will be as
follows:
Style 30% (comments, indenting and names)
Design 40% (good code, good organization)
Success 30% (does it compile, does it run without
bugs)
Programming
Assignment 5
Search Tree Cache of Glossary Words
Due ________________
You need to have a correct version of
project 4 to do project 5 so first fix all problems in project 4. Unless you do that you are not likely to get
more than 40% (of 100) in project 5.
In project 5 you will add a second GlossaryCreator to the creators array in glossarier.Main. The
fifth creator will insert the words into a binary search tree. The NAME string of this GlossaryCreator
should be tree. Otherwise the new
Glossary Creator will behave exactly like the unsorted glossary creator in
project 1.
When a web page is selected by the
user the work from both the unsorted and sorted glossary creators should be in
a table on the bottom of the glossaried page.
The grading system will be as
follows:
Style 30% (comments, indenting and names)
Design 40% (good code, good organization)
Success 30% (does it compile, does it run without
bugs)