public static void fastSort(int[] array)
    {
        int start = 0;
        int end = array.length-1;
        int mid = (start+end)/2;

        int i = start;
        int j = end;

        while (i < j)
        {
            while ((i < mid) && (array[i] <= array[mid])) i++;
            while ((j > mid) && (array[j] >= array[mid])) j--;
            if (i < j)
            {
                swap(array, i, j);
                if (i == mid)
                {
                    mid = j;
                }
                else if (j == mid)
                {
                    mid = i;
                }
            }
        }

        System.out.println(Arrays.toString(array));
    }