All Packages Class Hierarchy This Package Previous Next Index
Class DataStructures.QuadraticProbingHashTable
java.lang.Object
|
+----DataStructures.QuadraticProbingHashTable
- public class QuadraticProbingHashTable
- extends Object
Probing table implementation of hash tables.
Note that all "matching" is based on the equals method.
QuadraticProbingHashTable()
- Construct the hash table.
QuadraticProbingHashTable(int)
- Construct the hash table.
find(Hashable)
- Find an item in the hash table.
hash(String, int)
- A hash routine for String objects.
insert(Hashable)
- Insert into the hash table.
main(String[])
-
makeEmpty()
- Make the hash table logically empty.
remove(Hashable)
- Remove from the hash table.
QuadraticProbingHashTable
public QuadraticProbingHashTable()
- Construct the hash table.
QuadraticProbingHashTable
public QuadraticProbingHashTable(int size)
- Construct the hash table.
- Parameters:
- size - the approximate initial size.
insert
public void insert(Hashable x)
- Insert into the hash table. If the item is
already present, do nothing.
- Parameters:
- x - the item to insert.
remove
public void remove(Hashable x)
- Remove from the hash table.
- Parameters:
- x - the item to remove.
find
public Hashable find(Hashable x)
- Find an item in the hash table.
- Parameters:
- x - the item to search for.
- Returns:
- the matching item.
makeEmpty
public void makeEmpty()
- Make the hash table logically empty.
hash
public static int hash(String key,
int tableSize)
- A hash routine for String objects.
- Parameters:
- key - the String to hash.
- tableSize - the size of the hash table.
- Returns:
- the hash value.
main
public static void main(String[] args)
All Packages Class Hierarchy This Package Previous Next Index