public static void shuffle ( short [ ] shortArray ) { int swapPlace = - 1 ; for ( int i = 0 ; i < shortArray . length ; i ++ ) { swapPlace = ( int ) ( Math . random ( ) * ( shortArray . length - 1 ) ) ; XORSwap . swap ( shortArray , i , swapPlace ) ; } }
Randomly shuffle an short array