Home About

TIL: The Fisher-Yates Shuffle

… or how to efficiently produce a permutation of a set of elements.

https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle

Incidentally, it is available in math/rand since Go 1.10.

Look for enlightenment here.

Tags algorithms programming go
pancho horrillo
I do things with computers.
© 2007-2024 pancho horrillo