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.
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
.
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
:
get()
put()
rehash()
Test using LPOAHMTest
.
For OptimizedLPOpenAddressingHashMap.java
:
remove()
using the optimized
strategy described on pg 171.
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
.
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.