Problem 1: After inserting 13 elements into a hash table the result looks as in Figure ??. Being a good student, you realize this is a problem. (i) What is the problem here? (ii) Give an example of a hash function that could give rise to this behavior. (iii) What would be a better hash function? 0123 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0+ →→2131 → 2 → 30 33 63 15 266 388 Slika 1: Hash table. 1

icon
Related questions
Question
Problem 1: After inserting 13 elements into a hash table the result looks as in Figure ??.
Being a good student, you realize this is a problem.
(i) What is the problem here?
(ii) Give an example of a hash function that could give rise to this behavior.
(iii) What would be a better hash function?
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
0 →30
→→2131 → 1
2
→ 33
→15
→ 63
→ 266
388
Slika 1: Hash table.
Transcribed Image Text:Problem 1: After inserting 13 elements into a hash table the result looks as in Figure ??. Being a good student, you realize this is a problem. (i) What is the problem here? (ii) Give an example of a hash function that could give rise to this behavior. (iii) What would be a better hash function? 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 →30 →→2131 → 1 2 → 33 →15 → 63 → 266 388 Slika 1: Hash table.
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer