Random Numbers

Every day I’m shufflin’ Spotify launched in 2010 with a feature to let you shuffle your songs, allowing you to play them in a random order. This used an algorithm called the Fisher-Yates shuffle . The modern version of the Fisher-Yates shuffle works as follows: Start from the last element of the array (index n-1) Generate a random index j between 0 and i (inclusive) Swap the elements at positions…