void quick_sort(int* arr,int left,int right)
{
int low,hight;
low=left;
hight=right;
key=arr[low];
if(left<right)
{
while(low<hight)
{
while(low<hight&&arr[hight]>=key)
hight--;
arr[low]=arr[hight];
while(low<hight&&arr[low]<=key)
low++;
arr[hight]=arr[low];
}
arr[low]=key;
quick_sort(arr,left,low);
quick_sort(arr,low+1,right);
}
}
快速排序
最新推荐文章于 2024-09-12 15:56:42 发布