public class HashTableImproved<K,V> {
    private RW rw;
    private ListHead<K,V> [] a;
    private int n;
    public HashTableImproved (int n) {
	rw = new RW();
	a  = new ListHead[n];
	this.n = n;
    }
    public V lookup (K key) throws InterruptedException {
        int i = Math.abs(key.hashCode() % n);
        return a[i].lookup(key);
    }
    public void update (K key, V value) 
        		   throws InterruptedException {
        int i = Math.abs(key.hashCode() % n);
        a[i].update (key, value);
    }
}    
