Question: We are performing the following operations on a hash set implemented using separate chaining. The initial capacity is 5. The table automatically doubles and elements

We are performing the following operations on a hash set implemented using separate chaining. The initial capacity is 5. The table automatically doubles and elements are rehashed when an insert would cause the load factor to be greater than 2 (equal to 2 does not trigger a rehash). When a rehash is triggered, all the existing elements are rehashed into the new array in the order they are encountered when iterating over the hash set. Then the element that triggered the rehashing is inserted. Show the state of the array and the chains right before resizing and the final resized state after rehashing. When we add an element to a list, add policy is to add to the end of the list. The hash function is h = val % arrSize. + == insert, - == delete 22, 20, 12, 13, 32, 12, 14, 16, 29, 20, -12, 15, 11, 19, 33, 17, 28, 10, 1, -13, 9, 2, 35 (please grow the chains downward)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
