CSC 103 Assignment 3:
Hashing
10PM Wednesday 16 May 2001
Define a class named LookupTable with the following methods:
Entry 0: value ... Entry size-1: value
To support this class, define an interface LookupTableEntry, that has the same two methods as the example HashTableEntry, plus a getNext method that returns the next node in a chain of LookupTableEntrys.
The implementation requirements are the following:
Add the following methods to the LookupTable implementation of part A:
To support this class, define a subinterface of LookupTableEntry named LookupTableEntry2; LookupTableEntry2 adds two methods named getKey2() and hash2, for retrieving and hashing the secondary key of the entry
IMPORTANT: for part B, change all references in the part A implementation of of LookupTable from LookupTableEntry to LookupTableEntry2.
To the implementation of part B, add a sort method that returns a sorted array of LookupTableEntry2s, in ascending order by primary key.
For part A, define the analytic timing function for LookupTable.lookup, as discussed in Lecture Notes Week 6.
For part B, define the analytic timing function for LookupTable.resize, where resize is the name of the method that performs the table resizing when the load factor reaches 0.8.
For part C, define the analytic timing function for LookupTable.sort.
Provide class header, method, and inline documentation comments, using the javadoc standards illustrated in the 103 example programs.
There is a three-tier grading scheme for this assignment. If you're satisfied with no better than a "B" grade (i.e., 80%), do part A only. If you'd like the lowest possible "A" (i.e., 90%), do parts A and B. If you'd like to go for 100%, do parts all three parts A, B, and C.
Turn in one plain text file named analysis that contains all three parts of the analysis. Clearly label each of the parts A, B, and C (or as many of them as you do).
If you attempt part A only, turnin LookupTable.java and LookupTableEntry.java. If you attempt parts B and/or C, turnin LookupTable.java and LookupTableEntry2.java.