engineering recuitment GATE CSE 2023-24 Test Series Algorithms Searching, Sorting and Hashing Searching
A hash table of length(m) 11 uses open addressing and linear probing. After inserting 9 values into an empty hash table, the table is as shown below.
|
0 |
|
|
1 |
10 |
|
2 |
41 |
|
3 |
22 |
|
4 |
80 |
|
5 |
63 |
|
6 |
25 |
|
7 |
|
|
8 |
17 |
|
9 |
8 |
|
10 |
18 |
Which one of the following hash function will distribute elements as shown in above hash table.
1
h(k) = (k + 1)mod m) +1
2
h(k) = 1 + (k mod (m - 1))
3
h(k) = 1 + (k mod m)
4
h(k) = (k mod m)/(m - 1)