diff --git a/test0510.c b/test0510.c deleted file mode 100644 index a0bc12b9005087e967552b5b3fa91c94c06fc255..0000000000000000000000000000000000000000 --- a/test0510.c +++ /dev/null @@ -1,19 +0,0 @@ -//对区间[left,right]进行划分 - - -int Partition(int A[],int left, int right) -{ - int temp =A[left]; //存放到临时变量temp - - while(left < right) //只要left与right不相遇 - { - while(left < right && A[right] > temp) right--;//反复左移 - A[left] = A[right]; - - while(left < right && A[left] <= temp) left++;//反复右移 - A[right] = A[left]; - } - - A[left] = temp; //把temp放到right与left相遇的地方 - return left; //返回相遇下标 -} \ No newline at end of file