785. 快速排序 - AcWing题库https://www.acwing.com/problem/content/787/
786. 第k个数 - AcWing题库https://www.acwing.com/problem/content/788/
//排列中比较不能直接用l或r,只能用i或j #includeusing namespace std; const int N=1e6+10; int a[N];//全局变量 void qsort(int l,int r) { if(l>=r) return;//元素排完了,直接跳出来 int temp=a[l+r>>1],i=l-1,j=r+1; while(i temp);//右边找比基准大的 if(i 欢迎分享,转载请注明来源:内存溢出
评论列表(0条)