|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--DataStructures.QuadraticProbingHashTable
Probing table implementation of hash tables. Note that all "matching" is based on the equals method.
Constructor Summary | |
QuadraticProbingHashTable()
Construct the hash table. |
|
QuadraticProbingHashTable(int size)
Construct the hash table. |
Method Summary | |
Hashable |
find(Hashable x)
Find an item in the hash table. |
static int |
hash(java.lang.String key,
int tableSize)
A hash routine for String objects. |
void |
insert(Hashable x)
Insert into the hash table. |
static void |
main(java.lang.String[] args)
|
void |
makeEmpty()
Make the hash table logically empty. |
void |
remove(Hashable x)
Remove from the hash table. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public QuadraticProbingHashTable()
public QuadraticProbingHashTable(int size)
size
- the approximate initial size.Method Detail |
public void insert(Hashable x)
x
- the item to insert.public void remove(Hashable x)
x
- the item to remove.public Hashable find(Hashable x)
x
- the item to search for.public void makeEmpty()
public static int hash(java.lang.String key, int tableSize)
key
- the String to hash.tableSize
- the size of the hash table.public static void main(java.lang.String[] args)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |