Anonymous user
Knuth's algorithm S: Difference between revisions
→{{header|Python}}
(→{{header|Common Lisp}}: Marked for improvement as task function names have been ignored.) |
|||
Line 275:
elif random() < n / i:
# Keep item
return sample
return s_of_n
|