4 ms·
So a permutation? There's no need to store the whole shuffled array in RAM, a big 64-bit co-prime number is enough, you don't care about cryptographically secur
by Franciscouzo 7y ago
So a permutation? There's no need to store the whole shuffled array in RAM, a big 64-bit co-prime number is enough, you don't care about cryptographically secure numbers, so even 32 bits could work.
For example for a 1000 songs playlist, you choose n to be 2416648531, start with i = 0, you then get the following permutation: 0, 531, 62, 593, 124, 655, 186, 717, 248.