0

hello all,

I am writing a program to test sorting times, and I am having trouble with my quick sort. essentially, my quicksort is not sorting and I am having alot of trouble with it. Does anyone see any real problems with my implementation?

Thanks!

```
//--------------------------------------------------------
void quicksort(name_t *&charArray, int left, int right)
{
if (left < right)
{
int pivot = partition(charArray, left, right);
quicksort(charArray, left, pivot-1);
quicksort(charArray, pivot+1, right);
}
}
//--------------------------------------------------------
int findpivot (name_t *&charArray, int left, int right)
{return (left+right)/2;}
//--------------------------------------------------------
int partition(name_t *&charArray, int left, int right)
{
int pivot = findpivot(charArray,left,right);
char temp[31];
while (left < right)
{
while (charArray[left] < charArray[pivot]) left++;
while (charArray[right] > charArray[pivot]) right--;
if (left < right)
{
strcpy(temp,charArray[right]); //right
strcpy(charArray[right],charArray[left]);//right left
strcpy(charArray[left],temp);//left
}
else
{
return right;
}
}
}
```