Class HashedDictionary<K,V>
java.lang.Object
HashedDictionary<K,V>
public class HashedDictionary<K,V>
- extends java.lang.Object
A class that implements the ADT dictionary by using hashing
and linear probing to resolve collisions.
The dictionary is unsorted and has distinct search keys.
Notes: Uses probe for add, but locate for remove and getValue.
Uses linear probing, but includes code for quadratic probing.
Has a display method for illustration and testing.
- Version:
- 3.0
- Author:
- Frank M. Carrano
Methods inherited from class |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HashedDictionary
public HashedDictionary()
HashedDictionary
public HashedDictionary(int tableSize)
add
public V add(K key,
V value)
clear
public final void clear()
contains
public boolean contains(K key)
display
public void display()
getKeyIterator
public java.util.Iterator<K> getKeyIterator()
getSize
public int getSize()
getValue
public V getValue(K key)
getValueIterator
public java.util.Iterator<V> getValueIterator()
isEmpty
public boolean isEmpty()
isFull
public boolean isFull()
remove
public V remove(K key)