摘要: #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 <... 阅读全文
posted @ 2010-11-06 22:25 hailong 阅读(107) 评论(0) 推荐(1) 编辑
摘要: 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]<-... 阅读全文
posted @ 2010-11-06 09:30 hailong 阅读(4365) 评论(0) 推荐(0) 编辑