source/algorithms/quickSort.c
int partition(int vector[], int low, int high)
{
    int x = vector[high];
    int counter = (low-1);

    for(int i = low; i <= (high-1); i++)
    {
        if(vector[i] <= x)
        {
            counter++;
            swap(&vector[counter], &vector[i]);
        }
    }

    swap(&vector[counter+1], &vector[high]);

    return (counter+1);
}
//This function find and swap a smaller element in a partition.

This function find and swap a smaller element in a partition.
This function find and swap a smaller element in a partition .
int partition(int vector[], int low, int high)
{
    int x = vector[high];
    int counter = (low-1);
    for(int i = low; i <= (high-1); i++)
    {
        if(vector[i] <= x)
        {
            counter++;
            swap(&vector[counter], &vector[i]);
        }
    }
    swap(&vector[counter+1], &vector[high]);
    return (counter+1);
}
int partition ( int vector [ ] , int low , int high ) { int x = vector [ high ] ; int counter = ( low - 1 ) ; for ( int i = low ; i <= ( high - 1 ) ; i ++ ) { if ( vector [ i ] <= x ) { counter ++ ; swap ( & vector [ counter ] , & vector [ i ] ) ; } } swap ( & vector [ counter + 1 ] , & vector [ high ] ) ; return ( counter + 1 ) ; }
This function find and swap a smaller element in a partition.
This function find and swap a smaller element in a partition .