Computer Science 232
Data Structures and Problem Solving
Dickinson College
Spring Semester 2008
Grant Braught
Lab #9
Problem 
Due: 05/12/2008 at 9:00 am
- Comparing Hashing Techniques
- Package:
<username>.lab9.hashing
- Main Class:
HashExp.java
- Update the "Sample Code" project from the SVN server.
- Perform an empirical comparison of the performance of open hashing with linear probing to closed hashing with chaining. In order to do this you will need to:
- Find a partner.
- Find another pair with which to work.
- As a group of 4 determine a design for two implementations of the
HashMap interface, one using open hashing with probing and one with closed hashing with chaining. Consider if an abstract class should be used and if so what methods should be implemented in the abstract class and which should be left for the concrete classes.
- Split the group of 4 back into pairs. Each pair should implement the abstract class as discussed.
- One pair will generate and test an implementation of
HashMap that uses open addressing with linear probing. The other pair will generate and test an implementation of HashMap that uses closed addressing with chaining.
- Exchange your implementations so both pairs have both implementations.
- As a pair, design an experiment to compare the performance of the two implementations.
- As a pair, conduct the experiment.
- Create a brief (1-2 page) write-up describing your experiment, presenting the results and making recommendations for when each implementation should be used.
- Commit your solution to the SVN server before the due date.
- Turn in your write-up on the due date.
- BONUS: Further compare the performance of your two implementations to an implementation that uses open addressing with quadratic probing. You will need to do a little research to learn about quadratic probing and then produce and test an implementation that uses it.
Related Web Sites 
- JUnit Cookbook with some simple examples to get you started.
- A list of the JUnit Assertions
- Programming Resources: a collection of links that will be useful for many of the labs. Includes information using Eclipse and Subclipse, Java documentation for important I/O classes, JUnit and Unix tools and tips.