摘要:
#include <iostream>#include <time.h>#include <stdlib.h>using namespace std;int random(int a,int b){ srand(NULL); return rand()%(b-a)+a;}void exchange(int &a,int &b){ int temp; temp=a; a=b; b=temp;}int partition(int *a,int p,int r){ int x=a[r]; int i=p-1; for (int j=p;j<r 阅读全文
摘要:
#include <iostream>using namespace std;void exchange(int &a,int &b){ int temp; temp=a; a=b; b=temp;}int partition(int *a,int p,int r){ int x=a[r]; int i=p-1; for (int j=p;j<r;j++) { if (a[j]<=x) { i=i+1; exchange(a[i],a[j]); } } ... 阅读全文