Sort
文章平均质量分 77
XWang2014_SK
这个作者很懒,什么都没留下…
展开
-
Quick Sort
#include using namespace std; /* * choose the first element as pivot */ int partition(vector &v, int start, int end) { int pivot = v[start]; int left = start + 1; int right = end; while (tru原创 2013-02-12 17:07:09 · 161 阅读 · 0 评论 -
Merge Sort
The basic idea of Merge Sort can be outlined as follows: 1. Check to see if the vector is empty or has only one element. If so, it must already be sorted, and the function can return without do原创 2013-02-12 15:52:49 · 193 阅读 · 0 评论