I have implemented the quicksort algorithm using the last element as the pivot. Now I want to generate an array for the best-case scenario. This is the function that I wrote, but I am not sure that it works properly. Note: values are already sorted in increasing order, efficiency of the generateBestCase is not important
void generateBestCase(int *values, int left, int right) {
if (left>=right) return;
int mid = (left+right)/2;
swap(values[mid], values[right]);
generateBestCase(values, left, mid-1);
generateBestCase(values, mid+1, right-1);
}
int mid = left+(right-left)/2;