Given the following interface
public interface WordSet extends Iterable {
public void add(Word word); // Add word if not already added
public boolean contains(Word word); // Return true if word contained
public int size(); // Return current set size
public String toString(); // Print contained words
}
Implement the interface using
Hashing
Binary Search Tree
In the case of hashing, a rehash shall be performed when the number of inserted elements equals the number of buckets. For the binary search tree, the elements shall be sorted using the method compareTo. The names of the two implementations shall be HashWordSet and TreeWordSet. Note: In this task you are not allowed to use any predened classes from the Java library.