![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
模板或论文
文章平均质量分 70
Dai___
这个作者很懒,什么都没留下…
展开
-
归并排序的模板
//A为要进行排序的数组,T为临时数组,排序结束时两个数组中的元素相同//cnt统计逆序数的个数void merge_sort(int *A, int x, int y, int *T){ if(y-x > 1) { int m = x + (y-x)/2; int p = x, q = m, i = x; merge_sort原创 2013-10-27 14:51:19 · 659 阅读 · 0 评论 -
为什么程序设计中从0开始编号
Why numbering should start at zeroTo denote the subsequence of natural numbers 2, 3, ..., 12 without the pernicious three dots, four conventions are open to usa) 2 ≤ i b)转载 2014-01-30 11:18:34 · 1650 阅读 · 0 评论 -
扩展欧几里算法
int exgcd(int a, int b, int &x, int &y){ if(b ==0) { x = 1, y = 0; return a; } int r = exgcd(b, a%b, x, y); int t = x; x = y; y = t - a/b*y; return r; //r返回的是最大公约数}/* 扩展欧几里得算法在使用的原创 2014-02-26 15:29:44 · 1316 阅读 · 0 评论 -
最小生成树模板(Krustral)
#include #include #include #include #include using namespace std;const int N = 1024;typedef struct Node{ int s, e, val; Node(int a, int b, int c) { s = a, e = b, val = c;原创 2014-05-18 20:27:34 · 1132 阅读 · 0 评论