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