Question: 6. Hash Table (4 points) Suppose we have a bunch of keys in the range from 1 to 100. Consider inserting the keys 11,40, 19,20,67,2

6. Hash Table (4 points) Suppose we have a bunch of keys in the range from 1 to 100. Consider inserting the keys 11,40, 19,20,67,2 into a hash table of length 10 with the hash function h (k)-k%10. (1) (3 points) Illustrate the result of inserting these keys using linear probing to resolve collisions. Slot 0 Slot 1 Slot 2 Slot 4 Slot 5 Slot 6 Slot 7 Slot 8 Slot 9 2) (1 point) The hash function above resulted in some collisions. Why can't we instead just randomize the locations that keys are stored at? For example we could define a new hash function h, as follows: h,(k) = rand()%10 where rand) is a function that generates a random number
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
