Extra Helping Notes on HW4 - Luyi Workflow: WordCount.java is the main program of this project. It simply counts the words by reading words from file, putting them into the hashtable and updating their counts. And then it gets the counts array, sorts it and prints the data. You don't need to care about anything except for creating the working Hashtable. In either HashTable_SC or HashTable_OA you need to implement: incCount - *like insert()* takes a String and put it into the corresponding bucket (bucket number is the result from hashing the String) "When you insert something into a hashtable, you need to find where it goes (using a hasher) and then check for an existing element (using a comparator). " -- quote David Resizing should happen here. We recommend you keep a collection of prime numbers. You shouldn't need many, and every new size you choose should be a prime number approximately double of the previous one. After resizing, you should rehash every element by iterating over the table. getSize - how many unique Strings you have in your hashtable getCount - *like find()* find the corresponding count of the String passed in as parameter getIterator - discussed below Basically, your hashtable should countain pairs that store String and count, with String as key. Different Strings can be hashed into the same bucket when doing seperate chaining. Each bucket is a LinkedList. For open addresing, you can choose linear probing, quadratic probing or double hashing. Other confusions: Comparator It seems many of you wonder where the StringComparator should be used because you could write the program without it at all. However, we will keep the usage of StringComparator. You cannot use the equals and compareTo methods provided by Java String class. You are explicitly asked to use your StringComparator to compare strings. Here's some hints, a comparator is an object which contains comparison function. By implementing a comparator yourself, you can have control of ordering of Strings. By passing a StringComparator into the constructor of hashtables, you will be able to compare Strings with your compare methods defined in StringComparator class. Also you can safely ignore the String in <...>. The only String methods you should use are length and charAt. StringHasher Define the hashing rule for Strings, doesn't need to be a complicated one. But having a good hashing function will definitely be more efficient. Iterator Here is the java iterator explaination in JavaDoc, http://docs.oracle.com/javase/7/docs/api/java/util/Iterator.html It is basically an interface that has hasNext(), next(), and remove() methods. And it can iterate over a collection. Our SimpleIterator has the same idea, except that you don't need to implement the remove() method. So your getIterator() method will return an instance of SimpleIterator, which is to be written by your own. Here we encourage you to use an inner class or anonymous class, since a seperate class won't be able to access your data structure inside hashtable. Here is a detailed tutorial for anonymous class, which is perfect for this assignment. http://docs.oracle.com/javase/tutorial/java/javaOO/anonymousclasses.html What the iterator class does is that it goes over your hashtable, keeps track its position and see if it has the next element/get the next element. It returns a DataCount object which contains a String and its count. You probably want to use its functions when you rehash the tables. You can check discussion board for more help information. Posts are welcomed too.