Question: Let the interface HashTable contain the following basic methods: void insert (Type), boolean contains (Type), Type find (Type), void remove (Type). Suppose that the concrete

Let the interface HashTable contain the following basic methods: void insert (Type), boolean contains (Type), Type find (Type), void remove (Type). Suppose that the concrete class ItemAccessHashTable implements the HashTable interface and additionally supports the following methods: public Type [] getAllItems(): retrieves all items contained in this hash table. A no-argument constructor. (a) Implement the following method using an ItemAccessHashTable. Given a multi-set of items (i.e., vals), this method removes any duplicates and returns a set of items. public static Type Type [] removeDuplicates (Type [] vals); (b) Briefly discuss (verbally) how the method getAllItems could be implemented under (i) separate chaining and (ii) open addressing. For each implementation, also state the com- plexity of this member method. (c) State the complexity of your solution to (a) above. If any, exclude the cost of call(s) to getAllItems of (b) from your complexity analysis. Let the interface HashTable contain the following basic methods: void insert (Type), boolean contains (Type), Type find (Type), void remove (Type). Suppose that the concrete class ItemAccessHashTable implements the HashTable interface and additionally supports the following methods: public Type [] getAllItems(): retrieves all items contained in this hash table. A no-argument constructor. (a) Implement the following method using an ItemAccessHashTable. Given a multi-set of items (i.e., vals), this method removes any duplicates and returns a set of items. public static Type Type [] removeDuplicates (Type [] vals); (b) Briefly discuss (verbally) how the method getAllItems could be implemented under (i) separate chaining and (ii) open addressing. For each implementation, also state the com- plexity of this member method. (c) State the complexity of your solution to (a) above. If any, exclude the cost of call(s) to getAllItems of (b) from your complexity analysis
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
