Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ HashTable - spell checker program Need help writing this program; for this project, I have to implement a spelling checker. The spell checker will

C++ HashTable - spell checker program

Need help writing this program; for this project, I have to implement a spelling checker.

The spell checker will accept words from a dictionary and a document and then output the words in the document that are not in the dictionary. You should store the words in the dictionary in a hash table and your program should output statistics about the hash tables performance. The instructions are as follows: Implement the separate chaining HashTable template class as shown in Figures 5.65.10 (not including Figure 5.8) in the book Data Structures and Algorithm Analysis in C++. You should use your HashTable class to store the words (i.e. strings) in the dictionary. Use the hash function for strings from your textbook or if you can find a more efficient one from other sources. Add a new method to the HashTable classed called printStats() that prints the minimum, maximum, and mean chain length for all the chains in the hash table. Use the provided dictionary and documents You may assume that the dictionary file always have the filename dictionary.txt and the document file always have the filename document.txt. Save the dictionary and document files in the same directory as your executable code. The dictionary file contains one word per line, and the first line will be the number of words in the file. The words are all in lowercase. The document file contains lowercase words separated by spaces or new lines. Your program should work with any dictionary and document files that comply with the above constraints.

To provide a main program. Your main program should do the following:

(a) Create a hash table whose size is equal to the number of words in the dictionary.

(b) Read the words from the dictionary and store each one in the hash table.

(c) Output the statistics (i.e. minimum, maximum, and mean chain length) of the hash table after all words in the dictionary has been stored in the hash table.

(d) Read the words from the document and output each word that is NOT in the dictionary.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Secrets Of Analytical Leaders Insights From Information Insiders

Authors: Wayne Eckerson

1st Edition

1935504347, 9781935504344

More Books

Students also viewed these Databases questions