Reputation
231
Top tag
Next privilege 250 Rep.
View close votes
Badges
3 7
Impact
~9k people reached

  • 0 posts edited
  • 0 helpful flags
  • 8 votes cast
Aug
27
awarded  Good Question
Jun
21
awarded  Yearling
Sep
24
awarded  Autobiographer
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