Help with creating hash table functions

I am creating a simple hash table and I was given some source code by my professor. Instructions are as follows:

-Two tier hash table: buckets of main hash table are created through linked lists

-class "HashTableOne" is main hash table.

-HashTableOne requires add, find, and print public functions.

-class "HashTable3" has buckets that are implemented as objects of class "HashTableOne"

-HashTable3 also has add, find, and print public functions

Right now I am stuck at implementing the functions correctly. How do I get this hash table to work properly?


Code:

http://ideone.com/TDoa7D


Thanks in advance!
Your classes are mangled – for e.g you say that:

class "HashTableOne" is main hash table
but it is class HashTable3 that actually stores the:
... array of pointers to buckets
which in turn seems to be duplicated in the HashTableOne overloaded ctor
And HashTableOne, HashTable3 is a confusing naming convention, soon forgetting which was what. Why not call them LinkedList and HashTable respectively since a HashTable is an array of LinkedLists?
See here for a reasonable implementation of a Hashtable – there could be better ones around or you might write one yourself if you hunker down:
http://pumpkinprogrammer.com/2014/06/21/c-tutorial-intro-to-hash-tables/

Topic archived. No new replies allowed.