[Freeciv-Dev] Re: Hash tables
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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
|
|