![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Divide and Conquer
Goahead123321
这个作者很懒,什么都没留下…
展开
-
QuickSort
快速排序基本思想:对于partitioning的几点说明:1. 把数组中最右边的元素作为partitioning element;2. 从左向右扫描数组的元素,遇到 ">=partitioning element" 的情况就停止扫描;3. 从右向左扫描数组的元素,遇到 "#include #include using namespace std;void quick原创 2013-03-29 10:15:55 · 605 阅读 · 0 评论 -
Divide and Conquer
/* Alrogithms: Divide and Conquer 1) Binary Search 2) QuickSort 3) MergeSort 4) Maximum and minimum of an array using minimum number of comparisons 5) Closest Pair of Points*/#include using n原创 2013-08-04 22:06:09 · 730 阅读 · 0 评论 -
快速排序
#include using namespace std;void swap(int *a, int *b){ int temp = *a; *a = *b; *b = temp;}int partition(int a[], int left, int right){ int i = left-1; int j = right; int pivot = a[right原创 2013-08-17 15:20:02 · 639 阅读 · 0 评论