| CS285 -- Lab 5: Hash Tables |
|
|
OverviewIn this lab, you should develop a better understanding of hash tables. You should accomplish this by writing a hash table class and experimenting with different hash functions on the dictionary file data used in the previous lab. ProceduresThe first step is to write a templated hash table class that can vary in the type of data hashed, the number of buckets, and the hash function used. The hash table class should have member functions that will do the following:
The next step involves choosing an appropriate hash function and table size for the words in the dictionary used in the previous lab. You should implement at least three different hashing functions (select from the ones discussed in class or select your own). Experiment with the different hashing functions on hash tables of varying size. In addition, you should experiment with the hashing function by Bob Jenkins (given here) I have wrapped his hashing function in a function object that is described by JenkinsHash.h and JenkinsHash.cpp. You may find it useful develop your own metric for rating each hash table configuration. Based on your experimentation you should select one of the hash functions and a particular hash table size to use as your container for the dictionary for the next lab. Lab report (due 11:00pm, the day prior to week 9 lab)Your report should include:
IMPORTANT NOTE: Be sure to save your program for future use. We will be using this assignment in next week's lab assignment. As with any report you submit, correct spelling and grammar are required. In addition, your report should be submitted electronically following the Electronic submission guidelines. (You may wish to consult the sample report before submitting your report.) Be sure to keep copies of all your files, in case something gets lost. It may be wise to keep a diskette backup as well. Your grade will depend on quality of design, clarity of code and documentation, as well as whether your program produces the correct results. If you have any questions, consult your instructor. |
| © 2001-2002 Dr. Christopher C. Taylor | Office: CC-27C | Phone: 277-7339 | Last Updated: Mon Feb 4 14:31:43 2002 |
| I am responsible for all content posted on these pages; MSOE is welcome to share these opinions but may not want to. | |||