3 ms·
Fisher-Yates shuffle. An elegant and surprisingly intuitive O(n) algorithm that doesn't take up extra memory.
by yangmaster 8y ago
Fisher-Yates shuffle. An elegant and surprisingly intuitive O(n) algorithm that doesn't take up extra memory.
- malingo 8y agoCheck out Sattolo's algorithm as well. Good writeup here: https://danluu.com/sattolo/ https://danluu.com/sattolo/