/** * Interface for Dictionary. */ interface Dictionary { /** * Test if the Dictionary is logically * empty (contains no valid values). * @return true if empty, false otherwise. */ public boolean isEmpty(); /** * Return number of elements inserted into the Dictionary * @return number of Items in the Dictionary (i.e. "N"). */ public int numElements(); /** * Find an item in the Dictionary. * @param A the item to search for. * @return true if found. */ public boolean contains(AnyType A); /** * Insert into the Dictionary; duplicates are ignored. * @param A the item to insert. */ public void insert(AnyType A); /** * Resets the internal statistic counters to zero. */ public void resetStats(); /** * Return the requested statistic for a given data structure: * @param statistic requested, as follows: * For all data structures: * 1 = Number of locations examined (Excluding the location * an Item was found/placed.) * For Trees: * 2 = Tree Height * For Hash Tables: * 2 = Number of empty buckets * 3 = TableSize * @return the requested statistic. */ public int returnStats(int statType); }