Good Hash Function for Integers
Choose
tableSize is prime
hash(n) = n
Example:
tableSize = 7
insert(4)
insert(17)
find(12)
insert(9)
delete(17)
3
2
1
0
6
5
4
Previous slide
Next slide
Back to first slide
View graphic version