![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
排序
风吹过的烟花
这个作者很懒,什么都没留下…
展开
-
插入排序(c/c++)
https://github.com/lionliuchen/algorithm/tree/master/sort/Insertion-Sort 我摘维基百科的一部分 #include <iostream> #include <cstdio> #include <cstdlib> #include <ctime> //数组的长度 #define...原创 2018-09-30 22:21:27 · 174 阅读 · 0 评论 -
计算x的n次幂及运行时间
编写程序实现计算x的n次幂 采用两种算法 朴素算法:x*x*x...... 分治算法: n为偶数:x的n/2次幂*x的n/2次幂 n为奇数:x的(n-1)/2次幂*x的(n-1)/2次幂 代码 #include<bits/stdc++.h> using namespace std; //朴素算法 int pusu(int x,int n) { int...原创 2018-10-15 11:32:07 · 968 阅读 · 0 评论