|
void func(int* numbers, int left, int right)
{
int pivot, l_hold, r_hold;
l_hold = left;
r_hold = right;
pivot = numbers[left];
while (left < right)
{
while ((numbers[right] >= pivot) && (left < right))
right--;
if (left != right) {
numbers[left] = numbers[right];
left++;
}
while ((numbers[left] <= pivot) && (left < right))
left++;
if (left != right)
{
numbers[right] = numbers[left];
right--;
}
}
numbers[left] = pivot;
pivot = left;
left = l_hold;
right = r_hold;
if (left < pivot)
func(numbers, left, pivot-1);
if (right > pivot)
func(numbers, pivot+1, right);
}
What is this function for? If you are doing unit testing of this testing, which kind of parameters you want to pass in this function and what result you are expecting? |
|