probably weird or stupid newbie dictionary question
Nick Craig-Wood
nick at craig-wood.com
Thu Feb 10 05:30:02 EST 2005
Diez B. Roggisch <deetsNOSPAM at web.de> wrote:
> But what happens in case of a hash code clash? Then a list of (key, values)
> is stored, and for a passed key, each key in that list is additionally
> compared for being equal to the passed one. So another requirement of
> hashable objecst is the comparability. In java, this is done using the
> equals method.
>
> So in the end, the actual mapping of key, value looks like this:
>
> hash(key) -> [(key, value), ....]
Thats called hashing with chaining.
See Knuth: Sorting and Searching if you want to know more!
--
Nick Craig-Wood <nick at craig-wood.com> -- http://www.craig-wood.com/nick
More information about the Python-list
mailing list