替换图片链接

This commit is contained in:
programmercarl
2025-03-17 15:52:23 +08:00
parent 91e7dab72c
commit 86a0208485
216 changed files with 813 additions and 813 deletions

View File

@@ -69,7 +69,7 @@ int function3(int x, int n) {
我们来分析一下首先看递归了多少次呢可以把递归抽象出一棵满二叉树。刚刚同学写的这个算法可以用一棵满二叉树来表示为了方便表示选择n为偶数16如图
![递归算法的时间复杂度](https://code-thinking-1253855093.file.myqcloud.com/pics/20201209193909426.png)
![递归算法的时间复杂度](https://file.kamacoder.com/pics/20201209193909426.png)
当前这棵二叉树就是求x的n次方n为16的情况n为16的时候进行了多少次乘法运算呢
@@ -79,7 +79,7 @@ int function3(int x, int n) {
这么如果是求x的n次方这个递归树有多少个节点呢如下图所示(m为深度从0开始)
![递归求时间复杂度](https://code-thinking-1253855093.file.myqcloud.com/pics/20200728195531892.png)
![递归求时间复杂度](https://file.kamacoder.com/pics/20200728195531892.png)
**时间复杂度忽略掉常数项`-1`之后这个递归算法的时间复杂度依然是O(n)**。对你没看错依然是O(n)的时间复杂度!