摘要:
#include<iostream>using namespace std;void inline SWAP(int &a,int &b){ int temp = a; a = b; b = temp;}int paitition(int *a,int p,int r){ int i = p-1; int x = a[r-1]; for(int j = p; j <... 阅读全文
摘要:
quicksort(A,p,r){if p < r; then q<- partition(A,p,r) quicksort(A,p,q-1) quicksort(A,p+1,r)}其中partition(A,p,r){x<-A[r]i<-p-1for j<-p to r-1 do if A[j]<= x then i++; exchange A[i]<-... 阅读全文