homework 1 so that instead of storing values in hand-crafted linked list, the values are stored in a hand-crafted hash table that uses chaining for its collision resolution strategy. Your hashing data structure should be implemented as an OOP-based container class, but does not need to be generic.
You will actually need to create two hash tables:
Since you will have two very similar tables it makes sense to create an abstract WordHash class that has an abstract hash() method. Then inherit from that class into two subclasses with the hash method overridden in each.
There are a couple of ways to keep track of the different approaches. You might define six separate classes (all inheriting from the abstract WordHash method). The classes would each define an appropriate hash function (hash by word using in-class, hash by word using built-in, hash by word using custom, hash by code using in-class, hash by code using built-in, hash by code using custom).
I actually just used two classes that inherited from WordHash and in each class defined hashA(), hashB(), and hashC(). Then I had a fourth method called hash() that overrode the abstract hash() method in WordHash and called the appropriate method.
There are other ways this could be handled as well.
Programs will be graded according to the following criteria:
|Use of Version Control||2||pts|