Anonymous user
Knuth's algorithm S: Difference between revisions
m
→{{header|Ruby}}
(Updated D code) |
|||
Line 342:
if i <= n
sample << item
elsif rand <
sample[rand(n)] = item
end
|