191 reputation
16
bio website
location Chile
age 29
visits member for 3 years, 2 months
seen Jun 12 at 21:34

I am not funny


Feb
21
awarded  Notable Question
Apr
24
awarded  Popular Question
Jun
1
awarded  Nice Question
May
29
accepted Return random `list` item by its `weight`
May
29
revised Return random `list` item by its `weight`
added 8 characters in body
May
29
comment Return random `list` item by its `weight`
Good point about binary search
May
29
comment Return random `list` item by its `weight`
I've implement this algorithm in Ruby github.com/fl00r/pickup
May
29
awarded  Editor
May
29
revised Return random `list` item by its `weight`
added 78 characters in body
May
29
awarded  Student
May
29
awarded  Scholar
May
29
comment Return random `list` item by its `weight`
This was my first thought :). But what if I have got table with 100 fruits and weight could be around 10k? It will be very large array and this will be not as efficient as I want. This is about first solution. Second solution looks good
May
29
asked Return random `list` item by its `weight`
Apr
17
awarded  Supporter