Hi. I am very new to hashtable concept. Here is a skeleton of the methods I need to implement; BUT, my biggest question is the inner Entry class. Am I implementing the entry class correctly?Is my constructor correct? Thanks
public class HashTable<K, V> {
/** define an inner class to hold your Entry objects */
class Entry {
int hash;
protected K key;
protected V value;
Entry next;
public Entry(int hash, K key, V value, Entry next){
this.key = key;
this.value = value;
this.hash = hash;
this.next = next;
}
public K getKey(){
return this.key;
}
public V getValue(){
return this.value;
}
}
private double loadFactor = 0.75;
private final int defaultSize = 64;
private Object buckets[] = new Object[ defaultSize ];
private int numElements = 0;
public HashTable() {
buckets = new Entry[defaultSize];
}
public void put( K key, V value ) {
public V get( K key ) {
}
public Iterator<E> keys() {
public Iterator<V> values() {
}
}