Summary: Program 4 Page 1
CS 2420 Fall 2010
Program 4 20 points Check Eagle for due date.
Objective: In this assignment you are to going to implement a hash table with linked list chaining, and
then use it to implement a concordance (Concordance: a list of words used in a body of work, with a
count of the number of times the word occurs).
A hash table is a data structure that stores key/data pairs. When you add to a hash table you
provide both the key and the data. When you read from a hash table you give a key, and the data
structure returns the associated data. You can also test to see if any data is stored under the given
key. (In our case, there is really no data part (unless you count the occurenceCt).)
You will need to implement, at least, the following functions. Feel free to modify them as
HashTable(filename, size) constructor, initializes a hash table with the given table size and
insert keys from filename.
insert(key) inserts a key into the hash table
Pair * find (key) returns the Pair * of the key if the key is found in the hash table, and NULL
bool deleteKey(key) removes the entry with the given key. It returns a Boolean to indicate