permute/scramble arraylist elements in java

suppose I have arraylist of integers...is there a way that I can generate a random permutation/arrangement of the elements in the arraylist

so if the list is {1,2,3,4,5,6}

calling some method randomPermute() would change it to something random like

{1,3,2,6,5,4}

7
задан kamikaze_pilot 22 February 2011 в 04:35
поделиться