Implementation of the Knuth's 'Algorithm P' random shuffle