package hash;
public class HashTableTester {
public HashTableTester() {
}
public static void main(String[] args) {
String[] keys = {"one", "two", "three"};
String[] values = {"value1", "value2", "value3"};
HashTable<String, String> hashTable = new ChainingHashTable<String, String>();
for(int i=0; i<keys.length; i++ ){
hashTable.put(keys[i], values[i]);
}
hashTable.display();
System.out.println();
String key = "two";
System.out.println("The value of key " + key + " is " + hashTable.get(key));
key = "one";
System.out.println("The value of key " + key + " is " + hashTable.get(key));
System.out.println();
key = "three";
System.out.println("Removing the value of key " + key);
System.out.println();
hashTable.remove(key);
hashTable.display();
System.out.println();
System.out.println("Is the key " + key + " exists - " + hashTable.contains(key));
System.out.println();
key = "one";
System.out.println("Is the key " + key + " exists - " + hashTable.contains(key));
}
}