@@ -0,0 +1,1156 @@
+package week2;%0A%0Aimport java.util.Random;%0A%0A/**%0A * Author: Mark%0A * Date  : 2015/3/2%0A * Time  : 20:05%0A */%0Apublic class Shuffle %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A        Integer%5B%5D items = new Integer%5B10%5D;%0A        Random random = new Random(47);%0A        for (int i = 0; i %3C 10; i++) %7B%0A            items%5Bi%5D = random.nextInt(50);%0A        %7D%0A        printArray(items);%0A        new InsertionSort%3CInteger%3E().sort(items, 0, items.length);%0A        printArray(items);%0A%0A        shuffle(items, 0, items.length);%0A        printArray(items);%0A    %7D%0A%0A    private static void printArray(Comparable%5B%5D items) %7B%0A        for (Comparable i : items) %7B%0A            System.out.print(i + %22 %22);%0A        %7D%0A        System.out.println();%0A    %7D%0A%0A    public static void shuffle(Object%5B%5D items, int low, int high) %7B%0A        Random random = new Random(System.currentTimeMillis());%0A        for (int i = low + 1; i %3C high; i++) %7B%0A            int r = random.nextInt(i - low) + low;%0A            swap(items, r, i);%0A        %7D%0A    %7D%0A%0A    private static void swap(Object%5B%5D items, int n, int m) %7B%0A        Object tmp = items%5Bn%5D;%0A        items%5Bn%5D = items%5Bm%5D;%0A        items%5Bm%5D = tmp;%0A    %7D%0A%0A%7D%0A

add Shuffle