Re: Just wondering, anyone as insane as I?

From: Michael Buselli (
Date: 04/20/96

     Okay... I'm a little slow on reading my mail...

On Fri, 12 Apr 1996, Wout Mertens wrote:

> Michael B. did one... Michael? What did you use? hash(x) = x % 100 ? 
> (since every zone has max 99 rooms?)

hash(x) = x % n

where n is a number that is not divisible by anything that we, as humans, 
will naturally thing of as a natural thing to divide by.  I used a prime 
number as an example.  100 would be really bad, because then table[0] 
would have at least one room for every zone dangling on its list.  You 
want to make it so some zones start on table[3] and some on table[163] 
and some on table[X] and some on table[Y], hopefully spreading it around 
so that no two zones starts on the same table list, which will hopefully 
balance the number of rooms throughout the hash table.

     I can't write very well, so I hope the above paragraph made some 
sort of sick sense.

Michael Buselli

This archive was generated by hypermail 2b30 : 12/18/00 PST