摘要: int swap(int *pa, int *pb){ int t = *pa; *pa = *pb; *pb = t; return 0;}int partition(int a[], int s, int e){ int i = s - 1, j; for (j = s; j < e; ++j) { if (a[j] >= a[e]) { ++i; swap(a+i, a+j); } } ++i; swap(a+i, a+e); return i;}int qsort(int a[], int s, int e){ if (s ... 阅读全文
posted @ 2012-04-12 19:07 brucexu 阅读(184) 评论(0) 推荐(0) 编辑