Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!uflorida!novavax!proxftl!bill
From: bill@proxftl.UUCP (T. William Wells)
Newsgroups: comp.lang.c
Subject: Re: hash algorithm
Keywords: hash
Message-ID: <609@proxftl.UUCP>
Date: 19 Aug 88 04:00:02 GMT
References: <654@novavax.UUCP>
Reply-To: bill@proxftl.UUCP (T. William Wells)
Organization: Proximity Technology, Ft. Lauderdale
Lines: 14
Summary:
Expires:
Sender:
Followup-To:
Distribution:

In article <654@novavax.UUCP> raab@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.