Re: data structure for strings

From: Karl Heinz Buchegger <kbuchegg_at_gascad.at>
Date: 2000/07/24
Message-ID: <397C42EE.A681B90E_at_gascad.at>#1/1


Marc Tardif wrote:
>
> > On Sun, 23 Jul 2000 20:59:46 -0400, Marc Tardif <intmktg_at_Gloria.CAM.ORG> wrote:
> > >Any other ideas would be much appreciated.
> >
> > (Perfect) Hashfunctions ?
> >
> What are "perfect" hashfunctions? I tried using a simple hash function
> with a 131 (closest prime number) hash size. In the end, there were about
> as many duplicates in the hash table as if I simply used the first
> character of each of the 130 words in an array. Problem with this is that
> my worst case scenario has 10 words beginning with the same character,
> which is likely to slow me down.
>
> Anyways, please provide more information about this "perfect" hashfunction
> you mention. If too long or complicated, references would be much
> appreciated.

I think the comment was ment to be read as: There are no "general purpose perfect hash functions". For every problem you have to look at your expected data and derive a hash function for it.

-- 
Karl Heinz Buchegger
kbuchegg_at_gascad.at
Received on Mon Jul 24 2000 - 00:00:00 CEST

Original text of this message