Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2000:
[Freeciv-Dev] Re: Hash tables
Home

[Freeciv-Dev] Re: Hash tables

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Hash tables
From: sebauer@xxxxxxxxxxx (Sebastian Bauer)
Date: Sun, 26 Mar 2000 17:09:48 +0100

Hi Vasco

On 26-Mär-00, Vasco Alexandre Da Silva Costa wrote:
> i.e. each bucket contains a list of nodes.

> In the current implementation, each bucket can contain only one node.
> So if there is a colision, we have a big problem.

Since hashing was the last thing (but I haven't though about it really)
we had in university...if there is a collision you could also take
for example the next bucket and see if it free. If it is free take this
if not try the next again (this is called linear probing, there also
other methods but this is the simplest I guess).

Maybe this is an easier way with less overhead.

> Also, the size of an hash table (number of buckets) should be a prime
> number to reduce the number of colisions.

Yes, we learned that too :-)

bye,
Sebastian Bauer




[Prev in Thread] Current Thread [Next in Thread]