More hash functions
Key = real in [0,1]
For any M
h(K) = floor(K*M);
Key = string - Horner’s rule
int h(char *s)
{int j;
for (j=0; *s; s++) j=131*j + *s;
return (j % M)
}
Previous slide
Next slide
Back to first slide
View graphic version