Re: command_info binary tree

From: Patrick J. Dughi (dughi@IMAXX.NET)
Date: 01/07/98


>
> However, if anyone has hash table in use, and cares to share that segment
> of their code, I would love to read over it (I learn better from code
> than books ;-).  Doesn't matter what the code does, but the more related
> it is to what Im working on, the better I can understand it (plus more
> resources available to study it - i.e, the rest of Circle's source, and
> something to compare against).
>
        The dynamic board patch has a hash in it. Though its not a very
well thought out hash, it does work rather well.  Basically, it takes the
uid of the reader, the time stamp on the message, and creates a number in
the range of 0 to 300 - the hash table.  It also saves the timestamp and
message poster to double check that the file looked up is actually
correct.  to look up, just simply re-hash from the new data, and if you
have both a slot match on the table, and the saved data matches, you're
all set.

           It's really terribly simple.

                Just avoid powers of two for the #'s in your hash table -
it promotes clustering, and thats bad.

                                                PjD


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



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