题目描述
快速排序并输出
样例
输入:
5
2 3 4 5 1
输出:
1 2 3 4 5
C++ 代码
include[HTML_REMOVED]
using namespace std;
const int maxn = 1e5+5;
int a[maxn];
int n;
int Partition(int first,int end)//重点是明白如何分区
{
int i = first, j = end;
while(i[HTML_REMOVED]=a[i]) i;
if(i[HTML_REMOVED]>n;
for(int i=0;i[HTML_REMOVED]>a[i];
}
quickSort(0,n-1);
for(int i=0;i<n;i)
cout<<a[i]<<” “;
return 0;
}
老哥你这真的是c++代码吗