替换图片链接

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

@@ -17,7 +17,7 @@
示例 1
![](https://code-thinking-1253855093.file.myqcloud.com/pics/20201229175736596.png)
![](https://file.kamacoder.com/pics/20201229175736596.png)
* 输入:[0,0,null,0,0]
* 输出1
@@ -25,7 +25,7 @@
示例 2
![](https://code-thinking-1253855093.file.myqcloud.com/pics/2020122917584449.png)
![](https://file.kamacoder.com/pics/2020122917584449.png)
* 输入:[0,0,null,0,null,0,null,null,0]
* 输出2
@@ -143,7 +143,7 @@ if (cur == NULL) return 2;
如图:
![968.监控二叉树2](https://code-thinking-1253855093.file.myqcloud.com/pics/20201229203710729.png)
![968.监控二叉树2](https://file.kamacoder.com/pics/20201229203710729.png)
代码如下:
@@ -191,7 +191,7 @@ if (left == 1 || right == 1) return 2;
**从这个代码中可以看出如果left == 1, right == 0 怎么办其实这种条件在情况2中已经判断过了**,如图:
![968.监控二叉树1](https://code-thinking-1253855093.file.myqcloud.com/pics/2020122920362355.png)
![968.监控二叉树1](https://file.kamacoder.com/pics/2020122920362355.png)
这种情况也是大多数同学容易迷惑的情况。
@@ -199,7 +199,7 @@ if (left == 1 || right == 1) return 2;
以上都处理完了,递归结束之后,可能头结点 还有一个无覆盖的情况,如图:
![968.监控二叉树3](https://code-thinking-1253855093.file.myqcloud.com/pics/20201229203742446.png)
![968.监控二叉树3](https://file.kamacoder.com/pics/20201229203742446.png)
所以递归结束之后还要判断根节点如果没有覆盖result++,代码如下: