We don't bite newbies here... much | |
PerlMonks |
Re: Re: Weighted random numbers generatorby Eimi Metamorphoumai (Deacon) |
on Mar 13, 2003 at 17:44 UTC ( [id://242763]=note: print w/replies, xml ) | Need Help?? |
There's no way you can possibly do it in better than O(n) time, since you're going to have to look at each weight at least once (otherwise, ((1)x100, 10000) wouldn't be treated properly).
In Section
Seekers of Perl Wisdom
|
|