main.java
// splits the array based on the pivot, all smaller or equal pivot index and all greater are placed after
splits the array based on the pivot, all smaller or equal pivot index and all greater are placed after
splits the array based on the pivot all smaller or equal pivot index and all greater are placed after
public static int split(int[]arr, int low, int high)
    {
        int pivot = arr[high];
        int i = low-1;
        int temp = 0;
        for(int x = low; x<high; x++){
            if(arr[x] < pivot)
            {
                i++;
                temp = arr[i];
                arr[i] = arr[x];
                arr[x] = temp;
            }
        }
        temp = arr[i+1];
        arr[i+1] = arr[high];
        arr[high] = temp;
        return (i+1);
    }
public static int split ( int [ ] arr , int low , int high ) { int pivot = arr [ high ] ; int i = low - 1 ; int temp = 0 ; for ( int x = low ; x < high ; x ++ ) { if ( arr [ x ] < pivot ) { i ++ ; temp = arr [ i ] ; arr [ i ] = arr [ x ] ; arr [ x ] = temp ; } } temp = arr [ i + 1 ] ; arr [ i + 1 ] = arr [ high ] ; arr [ high ] = temp ; return ( i + 1 ) ; }
splits the array based on the pivot, all smaller or equal pivot index and all greater are placed after
splits the array based on the pivot all smaller or equal pivot index and all greater are placed after
//initial values are set // run through the array starting from low index ending before high (the pivot) //when item at x is less than the pivot we push it behind the current x this ensures that the small values stay bellow the index of pivot //we must now put the pivot in the correct location and return the index of pivot //we know that index i will end at the last value that is smaller than pivot so we place it right after i and put the value at i+1 at the end