Wyo Data Structures Ch. 8 Programming Assignment

Ch8Proj1.cpp

Write a program that uses a function named hash as a hashing function for English words. The function should receive an apstring passed by constant reference and it should return an integer that could be used to insert the apstring into a hash table that has room for 60 entries (1 slot per bucket). Write the hashing function so that it will minimize collisions between English words as much as possible. (Be sure that you are using the exact hash function prototype as prescribed by the directions above. Otherwise, your function will not link correctly to Mr. Minich's driver program and you will receive a zero grade!)

Also write a driver program that tests the hashing function by reading the text file at:

M :/DataStructures/Ch08/Ch8Proj1Data.txt

The driver program should use an apvector as a hash table and it should use linear probing for handling processing collisions when they occur. Probing should wrap around the 60 element hash table in a circular manner. The driver program should display the final hash table on the screen as well as the number of collisions that occurred. (Try to fit the hash table on the screen without any parts of it scrolling off the DOS console screen).

Whoever's hashing function causes the least collisions with Mr. Minich's text file will be declared the 2003 Wyomissing Hash Master!

When you've finished your driver program and hash function, copy and paste the hash function itself to a separate file named

H:/DataSt/Ch08/hash.h

Your program must follow the Coding Standards. Save the driver program's source code file as "Ch8Proj1.cpp" in the appropriate network folder.

Preconditions: