[Home]
[Contents]
[Chapter]
[Previous Algorithm]
[Next Algorithm]


Hashing function for strings


int hashfunction(s) char *s; { int i; for( i=0; *s; s++ ) i = 131*i + *s; return( i % m ); }

C source (331.hash.c)



© Addison-Wesley Publishing Co. Inc.