sets and maps the load factor the fullness of the hash set list is called its load factor we can find the load factor of hash set by dividing the number of items stored in the list by its length really small load factor means the list is much bigger than the number of items stored in it and the chance there is collision is small high load factor means more efficient space utilizationbut higher chance of collision experimentation can help to determine optimal load factorsbut reasonable maximum load factor is full when adding value into the listif the resulting load factor is greater than then all the values in the list must be transferred to new list to transfer the values to new list the values must be hashed again because the new list is different length this process is called rehashing in the hash set implementation we chose to double the size of the list when rehashing was necessary the code in sect calls the __add function from sect this code and the __add method are in the hashset class the __add and __rehash functions are hidden helper functions used by the publicly accessible add method hashset add def __rehash(oldlistnewlist)for in oldlistif !none and type( !hashset __placeholderhashset __add( ,newlist return newlist def add(selfitem)if hashset __add(item,self items)self numitems + load self numitems len(self itemsif load > self items hashset __rehash(self items,[none]* *len(self items)since the load factor is managedthe amortized complexity of adding value to the list is ( this means the length of any chain within the list will be finite length independent of the number of items in the hash set deleting an item deleting value from hash set means first finding the item this may involve doing linear search in the chain of values that reside at location in the list if the value to be deleted is the last in chain then it can be replaced with none if it is in the middle of chain then we cannot replace it with none because this would cut the chain of values insteadthe item is replaced with __placeholder object place holder object does not break chain and linear probe continues to search skipping over placeholder objects when necessary the remove helper function is given in sect this copy belongs to 'acha