#include
#include
using namespace std;
int Partition(int A[], int low, int high);
int SelectionRec(int A[], int low, int high, int k)
{
if(low <= high)
{
int pivot = Partition(A, low, high);
if(k == pivot+1)
{
return A[pivot];
}
else if(k > pivot+1)
{
return SelectionRec(A, pivot+1, high, k);
}
else
{
return SelectionRec(A, low, pivot-1, k);
}
}
else
{
cout<<"k超出界线!"<= pivot_key) --high;
A[low] = A[high];
while(low < high && A[low] <= pivot_key) ++low;
A[high] = A[low];
}
A[low] = pivot_key;
return low;
}
int main()
{
long const N = 10;
int A[N] = {3,2,5,6,8,9,1,0,4,7};
cout<