public void splitSorting(int[] array) {
    if (array == null) {
      throw new IllegalArgumentException("Array passed as parameter can't be null.");
    }

    boolean flag = true;
    while (flag) {
      flag = false;
      for (int j = 0; j < array.length - 1; j++) {
        if (array[j] > array[j + 1]) {
          swap(array, j, j + 1);
          flag = true;
        }
      }
    }
  }
The first solution implemented for this problem is based on the "Bubble Sort Algorithm".

The time complexity of this solution is O(N^2) where N is number of elements in the array. It is even worse
than the bubble sort algorithm because to check if we have to swap between any pair of elements is really
expensive. The space complexity of this algorithm is O(1) because we are not
using any additional data structure.
src/main/java/com/github/pedrovgs/problem8/SplitArray.java