Project: Open addressing with linear probing

1. Introduction

The goal of this project is to understand open-addressing hash tables. Most of what you do will apply to any probe strategy, although the last step applies only to linear probing.

This project corresponds to Project 6.3 in the book (pg 172--173). Refer to this for more details.

2. Set up

Find the project code at /homes/tvandrun/Public/cs345/hashing. This is the same code base as for the previous practice and the next project. The code contains packages adt, impl, and test.

3. Implementing linear probing

Your task in this project is to complete OpenAddressingHashMap.java and its child class OptimizedLPOpenAddressingHashMap.java. Note that OpenAddressingHashMap.java has a lot of code containing the probe strategies before you get to the main code for the class. Specifically for OpenAddressingHashMap.java:

Test using LPOAHMTest.

For OptimizedLPOpenAddressingHashMap.java:

Test using OLPOAHMTest. Note that this version of remove() should not leave any "deleteds" (ie, sentinel values) in the table, and deleted should always be zero. The Junit tests will fail if you violate this, that is, if you use something equivalent to the naive strategy from OpenAddressingHashMap.java.

4. Turn in

Copy the files you modified (OpenAddressingHashMap.java and OptimizedLPOpenAddressingHashMap.java) to your turn-in folder /cslab/class/cs345/(your id)/linearprob .

To keep up with the course, this should be finished by April 16.


Thomas VanDrunen
Last modified: Fri Apr 6 12:27:58 CDT 2018