Package dsa.lab05.solutions
Class HashFunction
java.lang.Object
dsa.lab05.solutions.HashFunction
A randomly-chosen hash function from a universal family.
- 
Constructor SummaryConstructorsConstructorDescriptionHashFunction(int size) Construct a hash function, randomly choosing its parameters.
- 
Method Summary
- 
Constructor Details- 
HashFunctionpublic HashFunction(int size) Construct a hash function, randomly choosing its parameters.- Parameters:
- size- the range of hashes that- hash(Object)should return
 
 
- 
- 
Method Details- 
sizepublic int size()Get the size of the range of hashes.- Returns:
- the range of hashes that hash(Object)should return
 
- 
hashHash the given object to a non-negative int less thansize().- Parameters:
- object- an object
- Returns:
- a hash of that object
 
 
-