Question: above, you cannot use Java s nasnCodej Imetnod in your nasn runction For this class, you must implement all the public methods in the DictionaryADT

 above, you cannot use Java s nasnCodej Imetnod in your nasn

above, you cannot use Java s nasnCodej Imetnod in your nasn runction For this class, you must implement all the public methods in the DictionaryADT interface public interface DictionaryADTf public int put(Word word) throws DictionaryException; public Word get (String inputWord); public Word remove(String inputWord) throws NoKeyException; public int size(); Below is description of these methods public int put(Word word) throws DictionaryException: Inserts the given Word object referenced by word into the dictionary. This method must throw a DictionaryException (see Page 7) if the String stored in the Word object (its key) is already in the dictionary You are required to implement the dictionary using a hash table with separate chaining. To determine how good your design is, we will count the number of collisions produced by your hash function. Method put must return 1 if the insertion of the Word object referenced by word produces a collision, and return 0 if no collision occurs. Recall that in separate chaining a collision occurs if Th(k) already contains at least one element, where h(k) is your hash function with key k and the table is T; there is no collision if T[h(k) is null public Word get (String inputWord): A method which returns the Word object with String inputWord as its key. It must return null if the word does not exist in the dictionary public Word remove (String inputWord) throws NoKeyException: Removes the Word record with String inputWord as its key from the dictionary, and returns it. This method must throw the NoKeyException (see Page 7) if the word is not in the dictionary. public int size (): Returns the number of records stored in the hash table (not the size of the table) Since your HashChainDictionary class must implement all the methods of the DictionaryADT interface, the declaration of your class should be as follows public class HashChainDictionary implements DictionaryADT You can download the file DictionaryADT. java from the course website on OWL. The only other public method that you can implement in the HashChainDictionary is the constructor, which must be declared as follows public HashDictionary(int size) this initializes a dictionary with an empty hash table of the specified size You can implement any other methods that you want to in this class, but they must be declared as private methods (i.e., not accessible to other classes above, you cannot use Java s nasnCodej Imetnod in your nasn runction For this class, you must implement all the public methods in the DictionaryADT interface public interface DictionaryADTf public int put(Word word) throws DictionaryException; public Word get (String inputWord); public Word remove(String inputWord) throws NoKeyException; public int size(); Below is description of these methods public int put(Word word) throws DictionaryException: Inserts the given Word object referenced by word into the dictionary. This method must throw a DictionaryException (see Page 7) if the String stored in the Word object (its key) is already in the dictionary You are required to implement the dictionary using a hash table with separate chaining. To determine how good your design is, we will count the number of collisions produced by your hash function. Method put must return 1 if the insertion of the Word object referenced by word produces a collision, and return 0 if no collision occurs. Recall that in separate chaining a collision occurs if Th(k) already contains at least one element, where h(k) is your hash function with key k and the table is T; there is no collision if T[h(k) is null public Word get (String inputWord): A method which returns the Word object with String inputWord as its key. It must return null if the word does not exist in the dictionary public Word remove (String inputWord) throws NoKeyException: Removes the Word record with String inputWord as its key from the dictionary, and returns it. This method must throw the NoKeyException (see Page 7) if the word is not in the dictionary. public int size (): Returns the number of records stored in the hash table (not the size of the table) Since your HashChainDictionary class must implement all the methods of the DictionaryADT interface, the declaration of your class should be as follows public class HashChainDictionary implements DictionaryADT You can download the file DictionaryADT. java from the course website on OWL. The only other public method that you can implement in the HashChainDictionary is the constructor, which must be declared as follows public HashDictionary(int size) this initializes a dictionary with an empty hash table of the specified size You can implement any other methods that you want to in this class, but they must be declared as private methods (i.e., not accessible to other classes

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!