ProgrammingAssignment-HashTable - Programming Assignment #6...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Programming Assignment #6 Submit - Due Thursday, April 5, 2007 at 10:30 am Hardcopy - Due the same day at the start of class This assignment gives you a chance to test your knowledge of hash tables. Specifically, you will develop an open- addressing-based hash table class that uses both linear probing (with ascending indexes) and double hashing to resolve collisions. You will also implement the two kinds of deletion policies that I demonstrated in class. The class will be templated and is named OAHashTable (for Open-Addressing Hash Table). It has a simple public interface as follows: Method Description Constructor. Config - The configuration for the hash table. The OAHTConfig struct has these members: InitialTableSize - The number of slots in the table initially. PrimaryHashFunc - The hash function used in all cases. SecondaryHashFunc - The hash function used in double hashing. If it is 0, then linear probing will be used. MaxLoadFactor - The maximum "fullness" of the table. GrowthFactor - The factor by which the table grows. DeletionPolicy - How to deal with deletions (marking or packing) FreeProc - The method provided by the client that may need to be called when data in the table is removed. ~OAHashTable(); Destructor. void insert( const char throw (OAHashTableException); Inserts a Key/Data pair into the table. Throws an exception if the data cannot be inserted. (E_DUPLICATE, E_NO_MEMORY) const char *Key) const throw (OAHashTableException); Finds the data in the table by key and returns a pointer to the data. Throws an exception if Key isn't found. (E_ITEM_NOT_FOUND)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

ProgrammingAssignment-HashTable - Programming Assignment #6...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online