快速排序算法-容器存储vector
<pre name="code" class="cpp">int quicksort(vector<int> &v, int left, int right){ if(left < right){
int key = v[left]; int low = left; int high = right;
while(low < high){
while(low < high && v[high] > key){
high--;
}
v[low] = v[high];
while(low < high && v[low] < key){
low++;
}
v[high] = v[low];
}
v[low] = key;
quicksort(v,left,low-1);
quicksort(v,low+1,right);
}
}