文章
13
粉丝
76
获赞
5
访问
7.9k
#include <bits/stdc++.h>
using namespace std;
int quickSort(int s[],int from, int to){
int l = from, r = to;
if(l >= r)
return -1;
int pivot = s[from];
while(l < r){
while(l < r && s[r] >= pivot)
r--;
s[l] = s[r];
while(l < r && s[l] <= pivot)
l++;
s[r] = s[l];
}
s[l] = pivot;
quickSort(s, from, l - 1);
quickSort(s, l + 1, to);
return l;
}
int main(){
int n;
scanf("%d", &n);
int *s1 = (int *)malloc(n * sizeof(int));
int *s2 = (int *)malloc(n * sizeof(int));
for(int i = 0; i < n; i++){
...
登录后发布评论
暂无评论,来抢沙发