Given a sequence of 5 keys < 53, 66, 32, 41, 88 > for searching task: a) Given the hash function H(k) = (3.k) mod 7, insert the keys above according to its original order (from left to right) into a hash table of 7 slots. Indicate the cases of collision. Clearly show the steps and calculation with a table. b) In case of any collisions found above in a) part, determine the new slot for each collided case using Linear Probing to solve the collision problem. Clearly show your answer for each identified case. No step of calculation required. o (Answer with “NO collision found”, in case there is no collisions found above) c) In case of any collisions found above in a) part, determine the new slot ONLY for the first collided case
Given a sequence of 5 keys < 53, 66, 32, 41, 88 > for searching task:
a) Given the hash function H(k) = (3.k) mod 7, insert the keys above according to its original order (from left to right) into a hash table of 7 slots. Indicate the cases of collision. Clearly show the steps and calculation with a table.
b) In case of any collisions found above in a) part, determine the new slot for each collided case using Linear Probing to solve the collision problem. Clearly show your answer for each identified case. No step of calculation required. o (Answer with “NO collision found”, in case there is no collisions found above)
c) In case of any collisions found above in a) part, determine the new slot ONLY for the first collided case using Double-Hashing (with functions below) to solve the collision problem. Clearly show the steps of your calculation.
d1 = H(k) = (3.k) mod 7
di = (di−1 + ((5·k) mod 6) + 1) mod 7 , i ≥ 2 o
(Answer with “NO collision found”, in case there is no collisions found above)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images