public static void main(String[] args) {
        int[] arr = {3,4,1,2,8,9,6,7};
        sort(arr, 3);
        for(int i = 0; i < arr.length; i++){
            System.out.print(arr[i] + " ");
        }
        System.out.println();

        int[] num = {3, 4, 1, 2, 8, 9, 6, 7};
        sort2(num, 2);
        for(int i = 0; i < num.length; i++){
            System.out.print(num[i] + " ");
        }
    }