public int[] generateSampling(int[] A, int m) {
        if (A == null || A.length <= m || m <= 0) {
            return A;
        }

        int[] subSet = new int[m];
        generateSamplingCore(A, A.length - 1, m);
        for (int i = 0; i < m; i++) {
            subSet[i] = A[i];
        }
        return subSet;
    }