Why it matters
Fisher-Yates is the standard shuffle. Bad variants (Naive) create bias; use the correct form.
Advertisement
The architecture
i from n-1 down to 1.
Swap i with random j in [0, i].
Uniform over permutations.
Advertisement
How it works end to end
Durstenfeld's in-place form.
Uniform over permutations.
Language libs implement.