Lab

Hash Table


Prelab Task:

    1.Reviwed what we learned for hash table and hash function

    2. Read and understand the header file d_hash.h, d_hashf.h, d_hiter.h,

Lab Task:

In this lab, you will develop a simple spelling checker using hash table.

1. Copy the following files: d_except.hd_hash.h, d_hashf.h, d_hiter.h, dict.dat and and spelltst.txt to your working directory for this lab and you may need them for your lab.

2. Name your program as lab_07.cpp.

Your program will:

2.1 Read the "dict.dat" file and insert the words into a hash table with with 1373 buckets. The file "dict.dat" contains 25,025 frequently used words, each on a separate line in lowercase.

2.2 Prompt for the name of a document. Read the document, and separate it into a sequence of words converted to lowercase by calling the function getWord.

2.3 Use the hash table, output a list of words that appear to be misspelled.

2.4 You may use the sample input file spelltst.txt  or your own input file for spelling checking. Compare your output with the sample output using the input file spelltst.txt

3. Demo your program to the instructor

What to Turn In:

Hand in the source codes for lab_07.cpp and sample input file and output to the instructor.