private int[] initRandomArray(int i) {
        Random r = new Random();
        int[] array = new int[i];
        for (int j = 0; j < array.length; j++) {
            array[j] = j;
        }
        /**
         * for i from n − 1 downto 1 do
         * j ← random integer with 0 ≤ j ≤ i
         * exchange a[j] and a[i]
         */
        for (int j = array.length - 1; j > 0; j--) {
            int rj = r.nextInt(array.length);
            int ar = array[rj];
            int aj = array[j];
            array[rj] = aj;
            array[j] = ar;
        }
        return array;
    }