public void bubSort() {
        int j = array.length - 1;
        while (j >= 0) {
            for (int k = 0; k < j; k++)
                if (array[k] > array[k + 1])
                    swap(k, k + 1);
            j--;
        }
    }