Outcomes Addressed

This assignment should be done individually

Procedure

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.

Relevant tidbit

You will not be able to use the HashSet to do your tests. You should use either an array or an ArrayList instead.

String.hashCode Overwriting

Create three new classes that contain a String as a field and override the hashCode() method.

Deliverable (in class Monday of week 10)

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.

Acknowledgment

This assignment was originally developed by Dr. Chris Taylor.

I am responsible for all content posted on these pages; MSOE is welcome to share these opinions but may not want to.
© 2001-2007 Dr. Christopher C. Taylor Office: L-343 Phone: 277-7339
Last Updated: Wednesday, 07-Feb-2007 10:20:39 CST