Re: Best way to hash a set of integers?



Richard Heathfield wrote:
Logan Shaw said:

Digital Puer wrote:
Ben Pfaff wrote:
"Digital Puer" <digital_puer@xxxxxxxxxxx> writes:

However, I'm still looking for info on how to best hash a *set*
of integers;

Can you
tell us anything about the sets?

I guess I'm looking for a way to compute what could be
called a multi-dimensional key. Suppose I have three integers
representing age, height (in cm), and weight (in lbs). I want
to somehow combine those together into a single key that will be
my index into a hash table (prior to doing mod hash_table_size).

That's not a set!

Yes it is. The word "set" has more than one meaning, and "bunch" is certainly one of them.

Well, that's true enough. Perhaps what I should've said to the
original poster is "by saying 'set of integers' and giving no
indication otherwise, you made it sound like you meant a set in
the mathematical sense". I don't object to using one of the
informal meanings of "set", but I do think making it clear which
meaning of the word is intended will make it easier for others
to offer help.

- Logan
.



Relevant Pages