摘要: 下面为求取组合数的代码: 1 #include 2 #define MAX 10009 3 int prime[168]; 4 void print(int *v, int length) 5 { 6 int i = 0; 7 for (; i m - n; i--) {38 ... 阅读全文
posted @ 2014-05-01 22:59 搬砖程序员带你飞 阅读(275) 评论(0) 推荐(0) 编辑
摘要: 简单堆排序 1 #include 2 #include 3 #include 4 #define Father(N) ((N - 1) >> 1) 5 #define Left(N) ((N 0) {39 int father = Father(N);40 ... 阅读全文
posted @ 2014-05-01 16:03 搬砖程序员带你飞 阅读(285) 评论(0) 推荐(0) 编辑
摘要: 一个简单的快速排序实现。其中,对比的节点为第一个结点。 1 #include 2 #include 3 #include 4 #define VectorMax 100 5 using namespace std; 6 int vector[VectorMax]; /* * * sor... 阅读全文
posted @ 2014-05-01 13:04 搬砖程序员带你飞 阅读(288) 评论(0) 推荐(0) 编辑