Making the String HashEasy to Compute
Use Horner’s Rule
int hash(String s) {
h = 0;
for (i = s.length() - 1; i >= 0; i--) {
h = (si + 128*h) % tableSize;
}
return h;
}
Previous slide
Next slide
Back to first slide
View graphic version