yes it is true, but now i cant get back because it is almost done and i only need this function to complete the code.
i am using this function to order the arrays of doubles, and the arrays of ints follow the moves of the arrays of doubles.
Code:
void quicksort(double *a, int n, int *array)
{
int i = 0;
int j = n-1;
double p = a[n/2];
assert(n>0);
do
{
while (a[i] > p)
i++;
while (p > a[j])
j--;
if (i<=j)
exchange(a, i++, j--,array);
}
while (i<=j);
if (j > 0)
quicksort(a, j+1,array);
if (i < n-1)
quicksort(a+i, n-i,array+i);
}
i need to use this function again but now only between two numbers, not from the beginning of the array to the end.
Have you an idea how i can make it with this function?