Exercise 5: Hash Table ---------------------- Description ----------- This exercise is an experiment in hash tables. You are to explore the effects of different hashing functions, effects of loading factor (capacity of the table), and two parameters: scaling factor and shift. What you have to submit is a table of results and a note on your observations (see the file results.txt) What needs to be done --------------------- - Download all the files in this directory - In HashTable.java implement the method public String stats(){...} // // return basic statistic on the hash table (as a String) ... // // capacity: capacity at creation time // size: number of entries in the table // collisions: number of buckets of size > 1 // maxBucketSize: the size of the largest bucket (an upper bound on search cost) // avgOccBucketSize: the average size of buckets that are occupied // - Perform experiments by varying the parameters N, scalingFactor and shift, using the dictionary.txt data set - Perform experiments by changing hashCode(String s), as follows: - using cut and paste, in HashTable.jav, replace the method hashCode(String s) with hash code functions from Arash Partow's "General Purpose Hash Function Algorithms Library" (GeneralHashFunctionLibrary.java) - enter your results into the file results.txt - upload the files HashTable.java and results.txt Hints and Tips -------------- 1. You could modify the program Test.java so that it is easier to perform your experiments. In fact, maybe write your own program Experiment.txt! 2. Maybe you could include all of Arash Paltrow's hash codes into the HashTable.java and have a parameter at ceation time to specify the hashCode? That might make things even easier. Patrick Prosser