in reply to How to randomly select a key whose value is between a range?
How many hash elements will you be working with? How dense is the distribution of values? Are all values between some range existent? How often does the hash's set of elements change? How much of the hash's total range will your target range span? Are the values actually integers, or will they be floating point?
If I were trying to come up with a solution that I would be happy with for my own purposes, I would want to know answers to these questions first. There are a lot of generalized solutions that could work, but to get a solution that is best for your specific needs, it would be useful if we knew a few more specifics.
Dave
|
|---|