[algogeeks] Re: generating a random number having uniform distribution using random coin flips

2008-04-18 Thread Zhang Fan
Can you explain it more detailedly? A number composed of randomly generated log b bits is a number distributed between [0, b], is it equal to random(a, b) ? On Tue, Apr 15, 2008 at 5:20 PM, Chonku <[EMAIL PROTECTED]> wrote: > What you need to generate is a random number between a & b using > r

[algogeeks] Re: A bi-direction hashtable

2008-04-18 Thread shalinmangar
Right, there is no way to get the hash-value of the key given only the value. So it is not possible to implement Find2(v) with only one Hashtable. Just as a reference, the same two-hashmap approach is used by the BiMap class in google-collections library. http://google-collections.googlecode.com