![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
递归与分治
我的笔记
这个作者很懒,什么都没留下…
展开
-
全排列个数
f(n)=n*f(n-1)原创 2015-09-23 23:31:32 · 611 阅读 · 0 评论 -
整数划分
f(n,m)=f(n-m,m)+f(n,m-1)原创 2015-09-23 23:32:47 · 164 阅读 · 0 评论 -
汉诺塔
#include //第一个塔为初始塔,中间的塔为借用塔,最后一个塔为目标塔 int i=1;//记录步数 void move(int n,char from,char to) //将编号为n的盘子由from移动到to {printf("第%d步:将%d号盘子%c---->%c\n",i++,n,from,to); } void hanoi(int n,char from,char denpen原创 2015-09-23 23:33:18 · 273 阅读 · 0 评论