![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
排序算法
sliyangz
这个作者很懒,什么都没留下…
展开
-
快速排序
#include using namespace std; int partition(int *p, int len) { int i = -1; int key = *(p + len); for (int j = 0; j <=len; j++) { if (*(p + j) <= key) { i = i + 1; int temp = *(p + i);原创 2016-10-05 21:35:33 · 160 阅读 · 0 评论 -
python 随机快速排序法
import random def quicksort(arr,firstIndex, lastIndex): if firstIndex<lastIndex: divIndex=random_partition(arr,firstIndex, lastIndex) #print(divIndex) quicksort(arr,fi...原创 2018-08-11 11:24:54 · 2162 阅读 · 0 评论