hash algorithm

T. William Wells bill at proxftl.UUCP
Fri Aug 19 14:00:02 AEST 1988


In article <654 at novavax.UUCP> raab at novavax.UUCP (Moshe Raab) writes:
: could anyone recommend a hashing algorithm to store a list of 10
: digit phone numbers (area code plus 7 digits).
: It should have little or no overflow and no collisions (as few as
: possible). The list will contain more than one area code but
: about 1000 numbers per area code (ie not a totasly random sample
: but one which has a relatively common prefix)
: thank you very much.

You might want to try a hash trie (sic).  The Programming Pearls
column in the June 1986 Communications of the ACM describes one
way to do this.  I have not tried this so I can give you no
estimates on the space needed to do it, but access to a hash trie
is very fast though perhaps not as fast as a very sparse hash
table.



More information about the Comp.lang.c mailing list