快速排序代码
摘要:
#include <iostream>using namespace std;void swap(int* p, int* q){ int temp= *p; *p =*q; *q =temp;}int partition(int* a,int low,int high){ int pivot =a[low]; while(low<high) { while((pivot<=a[high])&&(high>low)) high--; swap(&a[low],&a[high]); while((pivot>=a[low])&a 阅读全文
posted @ 2013-03-19 16:05 mymemory 阅读(130) 评论(0) 推荐(0)