Question: Please use python programming language for this. Implement the class HashMap with a hash table data structure, using an indexable collection (array or python list

 Please use python programming language for this. Implement the class HashMap

Please use python programming language for this.

Implement the class HashMap with a hash table data structure, using an indexable collection (array or python list that can retrieve a value at a given index in 0(1) time) of Bucket The class must fully implement the Map ADT, including the following operations insert(key, data) Adds this value pair to the collection o If equal key is already in the collection, raise ItemExistsException) o . update(key, data) o Sets the data value of the value pair with equal key to data o If equal key is not in the collection, raise NotFoundException0 * find(key) o Returns the data value of the value pair with equal key o If equal key is not in the collection, raise NotFoundException0 o Returns True if equal key is found in the collection, otherwise False o Removes the value pair with equal key from the collection . contains(key) * remove(key) o If equal key is not in the collection, raise NotFoundException0 o Override to allow this syntax o If equal key is already in the collection, update its data value o setitem (self, key, data) some hash map[key]- data Otherwise add the value pair to the collection * _getitem_(self, key) o Override to allow this syntax my_data-some_hash_map[key] o Returns the data value of the value pair with equal key o If equal key is not in the collection, raise NotFoundException0) o Override to allow this syntax o Returns the number of items in the ene data structure . len (self) length_of_structurelen(some_hash map) When the number of items in the HashMap has reached 120% of the number of buckets (length of array or list) it must rebuild(), doubling the number of buckets

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!