|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.mhhe.clrs2e.OpenAddressingHashTable | +--com.mhhe.clrs2e.QuadraticProbingHashTable
Implements a hash table with quadratic probing as described on pages 239-240 of Introduction to Algorithms, Second edition.
Field Summary | |
private double |
c1
Constant used for quadratic probing. |
private double |
c2
Constant used for quadratic probing. |
Fields inherited from class com.mhhe.clrs2e.OpenAddressingHashTable |
m |
Constructor Summary | |
QuadraticProbingHashTable()
Creates a new open-addressed hash table with quadratic probing with 16 entries. |
|
QuadraticProbingHashTable(int size,
double c1,
double c2)
Creates a new open-addressed hash table with quadratic probing of a given size. |
Method Summary | |
protected int |
hash(java.lang.Object o,
int i)
Computes a hash function for an open-addressing hash table, uslng quadratic probing. |
Methods inherited from class com.mhhe.clrs2e.OpenAddressingHashTable |
delete, insert, search, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private double c1
private double c2
Constructor Detail |
public QuadraticProbingHashTable()
c1
=
0.5 and c2
= 0.5.
public QuadraticProbingHashTable(int size, double c1, double c2)
c1
- One of the constants used for probing.c2
- The other constant used for probing.Method Detail |
protected int hash(java.lang.Object o, int i)
hash
in class OpenAddressingHashTable
o
- An object. If the object implements
DynamicSetElement
, the hash value is of its key.i
- The probe number.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |