private int[] initializeRandomTable(int size) {
        r = new Random();
        System.out.println("\nGenerating random input...");
        int[] randomTable = new int[size];
        for (int i = 0; i < randomTable.length; i++) {
            randomTable[i] = r.nextInt(size);
        }
        return randomTable;
    }