[Mono-list] Delving in to System.Collections.Hashtable

John Barnette jbarn@httcb.net
Thu, 12 Jul 2001 15:25:40 -0600


> From: Nelson Minar [mailto:nelson@monkey.org]
>
> >When I look at System.Collections.IDictionaryEntry, though, I don't
> >see a 'Next' attribute or anything else that would allow a linked
> >list in this fashion.
>
> Could it be hidden? I don't know, and reverse engineering it might not
> be a good idea.
>
> Another option to handle collisions is double hashing
>   http://hissa.nist.gov/dads/HTML/doublehashng.html
> maybe that's what the implementation does?

There's a phrase in the class library docs that made me fairly certain that
it was a separate-chaining implementation: "When an entry is added to the
Hashtable, the entry is placed into a bucket based on the hash code of the
key. Subsequent lookups of the key use the hash code of the key to search in
only one particular bucket, thus substantially reducing the number of key
comparisons required to find an entry."

Whaddya think?


~ j.