摘要: Problem Description Many years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , s 阅读全文
posted @ 2016-06-12 20:35 多一份不为什么的坚持 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 问题描述: 有n阶楼梯,每次只能迈一步或两步,输出有多少种迈法到达楼顶。 解题心得: 递归方法:先考虑最后一步,可能是迈了一步,可能是迈了两步。所以step(n)=step(n-1)+step(n-2),然后step(0)=1,step(1)=1; 但是递归方法时间复杂度太高,n=40就已经需要一段 阅读全文
posted @ 2016-06-12 20:28 多一份不为什么的坚持 阅读(500) 评论(0) 推荐(0) 编辑