b. [1.5 points] Say, we have the following keys to be stored in a dictionary.
keys = {2,3,9,6,11,13,7,12}
The hash table for contains 10 slots, and the index to the hash table is given by
the following hash function
H(k) = ((pre-hash(k) mod m), where m is the size of the hash table
Pre-hash(k) = 2*k + 3
For resolving collision, we are using closed addressing with quadratic probing. Fill
the following table and hash table with correct key values.
Key Pre- Index Index
k hash(k) =
with
Index
with
Index
Index
Index
with
with
with
Hash quadratic quadratic quadratic quadratic quadratic
probing, i probing, i probing, i probing, i
value probing i
H(K) = 0
= 1
(Same as
H(K))
= 2
= 3
= 4
0
1
2
3
4
5
6
7
8
9
Hash Table:
Index
Key