python hash table implementation in this sectionwe develop two implementations of hash tableone using separate chaining and the other using open addressing with linear probing while these approaches to collision resolution are quite differentthere are great many commonalities to the hashing algorithms for that reasonwe extend the mapbase class (from code fragment )to define new hashmapbase class (see code fragment )providing much of the common functionality to our two hash table implementations the main design elements of the hashmapbase class arethe bucket array is represented as python listnamed self tablewith all entries initialized to none we maintain an instance variable self that represents the number of distinct items that are currently stored in the hash table if the load factor of the table increases beyond we double the size of the table and rehash all items into the new table we define hash function utility method that relies on python' built-in hash function to produce hash codes for keysand randomized multiplyadd-and-divide (madformula for the compression function what is not implemented in the base class is any notion of how "bucketshould be represented with separate chainingeach bucket will be an independent structure with open addressinghoweverthere is no tangible container for each bucketthe "bucketsare effectively interleaved due to the probing sequences in our designthe hashmapbase class presumes the following to be abstract methodswhich must be implemented by each concrete subclassbucket getitem(jkthis method should search bucket for an item having key kreturning the associated valueif foundor else raising keyerror bucket setitem(jkvthis method should modify bucket so that key becomes associated with value if the key already existsthe new value overwrites the existing value otherwisea new item is inserted and this method is responsible for incrementing self bucket delitem(jkthis method should remove the item from bucket having key kor raise keyerror if no such item exists (self is decremented after this method iter this is the standard map method to iterate through all keys of the map our base class does not delegate this on per-bucket basis because "bucketsin open addressing are not inherently disjoint