Your program should generate all of the results for the following table:
| Method | # of collisions | # of empty buckets | Maximum # of elements in a bucket |
| HC1 with 100,000 size table | |||
| HC1 with 1,000,000 size table | |||
| HC1 with 10,000,000 size table | |||
| HC2 with 100,000 size table | |||
| HC2 with 1,000,000 size table | |||
| HC2 with 10,000,000 size table | |||
| HC3 with 100,000 size table | |||
| HC3 with 1,000,000 size table | |||
| HC3 with 10,000,000 size table | |||
| HC4 with 100,000 size table | |||
| HC4 with 1,000,000 size table | |||
| HC4 with 10,000,000 size table |
Where HC? represent the following hashCode implementations:
You should use the words.txt file as your input data set when generating the above table.
You will not be able to use the HashSet to do your tests. You should use either an array or an ArrayList instead.
Create three new classes that contain a String as a field and override the hashCode() method.
You should submit the completed table and a brief (1-2 paragraphs) discussion on which ranks the four hash code methods and identifies an optimal table size for each. Are any of the hash code methods clearly superior or inferior to the others?
Your submission may either be in the form of an email message or hardcopy.
If you have any questions, consult your instructor.
This assignment was originally developed by Dr. Chris Taylor.
| © 2001-2007 Dr. Christopher C. Taylor | Office: L-343 | Phone: 277-7339 |