![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c/c++
joke_shaw
喜欢Cocos2dx引擎技术, 喜欢IOS,技术分享, 让自己成长
展开
-
C++实现插入排序
c++插入排序void InsertSort(int *arr, int n){ if (!arr || n <= 1) return; for (int i=2; i<n; ++i) { int tmp = arr[i]; int j=i; for (; j>0; --j) { if (tmp > arr[j-1]) { a...原创 2018-12-20 15:22:42 · 106 阅读 · 0 评论 -
归并算法
void PrintArr(int *arr, int n){ if (!arr || n <= 0 ) return; for (int i=0; i<n; ++i) { std::cout << arr[i] << " "; } std::cout << std::endl; return;}void Merge(int ...原创 2018-12-20 17:16:49 · 85 阅读 · 0 评论 -
快速排序
快速排序// An highlighted blockvoid _QuickSort(int *data, int left, int right){ if (left >= right) { return; } int pick_index = RandomPick(left, right); int pick_data = data[pick_index]; d...原创 2018-12-27 19:35:45 · 97 阅读 · 0 评论