1 / 7
Settings
<<<>>>
Now we try the alternate second hash function. Use a hash table of size M = 16 (a power of 2), our primary hash function is a simple mod on the table size (as usual), and our secondary hash function is to do linear probing by steps of size h2(k) = (((k/M) % (M/2)) * 2) + 1.
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
h2(k) = (((k/M) % (M/2)) * 2) + 1