Quote:
Originally Posted by theNbomr
Since addresses of distinct variables are already unique, what do you gain by accessing the variables via a hash lookup? Am I missing something here, or is this a purely academic exercise (homework)?
--- rod.
|
A 32 bit address can index up 4 billion unique elements. He is probably only hashing a few hundred to a few thousand entries, so he wants a function that will give a good hash of a 32 bit integer.
If you search google, you'll get a bunch. Just choose one that looks good to you. You can try a few and see which one gives you less collisions. Addresses won't be random, they'll probably bunch up together, so you may have to be careful.