|
|
|
|
|
by fanf2
173 days ago
|
|
There are actually four variants: • loop counts downwards vs upwards • the processed part of the array is a uniform sample of the whole array, or it is a segment that has been uniformly shuffled Knuth described only the downwards sampling version, which is probably why it’s the most common. The variants are compared quite well on wikipedia https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle |
|