to use objects of user-defined class as keys in the dictionarythe class must implement both the hash and eq methods the hash method should hash the contents of the object and return an integer that can be used by either of our two hash functionsh(and hp(the eq is needed for the equality comparison in line of listing which determines if the key stored in the given slot is the target key searching as we have seena search has to be performed no matter which hash table operation we use to aide in the searchwe create the findslot(helper method as shown in lines - searching the table to determine if key is simply contained in the table and searching for key to be deleted require the same sequence of steps after mapping the key to its home positionwe determine if the key was found at this location or if probe has to be performed when probingwe step through the keys using the step size returned by the second hash function the probe continues until the key has been located or we encounter an unused slot (contains null referencethe search used to locate slot for the insertion of new keyhoweverhas one major difference the probe must also terminate if we encounter table entry marked as empty from previously deleted key since new key can be stored in such an entry this minor difference between the two types of searches is handled by the forinsert argument when truea search is performed for the location where new key can be inserted and the index of that location is returned when the argument is falsea normal search is performed and either the index of the entry containing the key is returned or none is returned when the key is not in the table when used in the contains and valueof(methodsthe findslot(method is called with value of false for the forinsert argument insertions the add(method also uses the findslot(helper method in factit' called twice firstwe determine if the key is in the table that indirectly calls the contains method if the key is in the tablewe have to locate the key through normal search and modify its corresponding value on the otherif the key is not in the tablefindslot is called with value of true passed to the forinsert argument to locate the next available slot finallyif the key is new and has to be added to the tablewe check the count and determine if it exceeds the load factorin which case the table has to be rehashed the remove operation and the implementation of an iterator for use with this new version of the map adt are left as exercises rehashing the rehash operation is shown in lines - of listing the first step is to create new larger array for simplicitythe new size is computed to be