Homework 5 - Hash Tables

Due: Friday October 26, 2007 at 5pm

For this assignment, you will implement an integer array-based hash table that uses double hashing. The header for this class is hash.h. Since we are using sentinel values (EMPTY_VALUE and DELETED_VALUE), the search, insert and delete should not allow those two sentinel values in the table. You may opt to only allow positive integers to be inserted into the table or to disallow these two values. Be consistent with your choice. Insert and delete should also appropriately adjust the count variable to reflect the count of elements in the table. For your primary hash function, use the modulo hash function. For your secondary hash function, use

R - (value % R)
where R is a prime smaller than MAX_CAPACITY.

To test your hash table class, write the following menu as your main function:

          Hash Table Menu
  ===================================
  1. Insert an integer into the table
  2. Delete an integer from the table
  3. Search the table for an integer
  4. Print the primary and secondary 
     keys for an integer

  0. Exit
  ===================================