Assignment 6 - A Generic Hash Table Spell Checker
due Thursday, November 17th
The goal of this assigment is to give you practice in creating and using class templates and applying other concepts covered in the course.
You are to create a generic (class template) hash table. You will use this template to create another "Dictionary" of words. And, as before, you'll be given a document to spell check.
Requirements
- The "Dictionary" will contain around 25000 words. Your hash table should contain 1000 - 2000 "buckets". The hash table should have a "client-defined" size (number of buckets).
- Use "chaining" to resolve "collisions" in your hash table. You can use the generic linked list code that was presented in class on Thursday, Nov 5th.
- This is a generic hash table, so you'll use a class template, even though you will most likely instantiate it for only one type in this assignment.
- You will be using a new word file and a new document to "spell check". The word file contains a few duplicate "words". You are to throw, a catch, exceptions for this situation.
- Here is the "word" file and the "document"
- Your hash table class template should have "insert" and "find" member functions and others needed to obtain the following required statistics.
- Number of words in the dictionary
- Percent of "buckets" used
- Average size of the the non-empty "buckets"
- Largest "bucket" size
Your output should look "similar" to the following:
Duplicate class mystring value: clone
Duplicate class mystring value: duplicate
Duplicate class mystring value: resting
...
Duplicate class mystring value: two
Number of words in the dictionary = ????? <-- You need a number here
Not found in the dictionary: three-quarters
Not found in the dictionary: self-destruction
...
Total mispelled words = ? <-- You need a number here
Percent of hash table buckets used = ???% <-- You need a number here
Average non-empty bucket size = ?? <-- You need a number here
Largest bucket size = ??? <-- You need a number here