![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
常用算法
文章平均质量分 51
xingdebocqyz
这个作者很懒,什么都没留下…
展开
-
数组排列/全排列(data数组没有重复元素)
思想:依次生成以data[0]开头的所有排列,data[1]开头的所有排列... #include "iostream" #include "iterator" #include "algorithm" using namespace std; int data[5] = {1,2,3,4,5}; void perm(int index[],int n, int k) {转载 2013-09-18 18:33:32 · 622 阅读 · 0 评论 -
快速排序
#include "iostream" #include "vector" using namespace std; void qSort(int a[], int l,int r){ if(l >= r) return; int i = l,j = r,key = a[l]; while(i < j){ while(i = key) j--;转载 2013-09-18 19:28:41 · 537 阅读 · 0 评论 -
一致性哈希算法及其在分布式系统中的应用
http://blog.codinglabs.org/articles/consistent-hashing.html转载 2013-10-16 17:30:24 · 590 阅读 · 0 评论