摘要: 求斐波那契数列常用循环和递归2种方式。 通过剪枝优化,可以将递归的时间复杂度进行优化。 可以对比以下三种算法。 import timefrom matplotlib import pyplot #计时器def timer(func): def wrapper(*arg): start=time.ti 阅读全文
posted @ 2020-08-11 10:08 とうさん 阅读(277) 评论(0) 推荐(0) 编辑