Skip to content

Commit 56a7c68

Browse files
authoredMay 14, 2024
Merge pull request youngyangyang04#2533 from VoxDai/patch-1
Update 0111.二叉树的最小深度.md / Fix typo
2 parents ba12ff6 + 9fdaeb5 commit 56a7c68

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎problems/0111.二叉树的最小深度.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464

6565
代码如下:
6666

67-
```
67+
```CPP
6868
int getDepth(TreeNode* node)
6969
```
7070

@@ -74,14 +74,14 @@ int getDepth(TreeNode* node)
7474

7575
代码如下:
7676

77-
```
77+
```CPP
7878
if (node == NULLreturn 0;
7979
```
8080

8181
3. 确定单层递归的逻辑
8282

8383
这块和求最大深度可就不一样了,一些同学可能会写如下代码:
84-
```
84+
```CPP
8585
int leftDepth = getDepth(node->left);
8686
int rightDepth = getDepth(node->right);
8787
int result = 1 + min(leftDepth, rightDepth);

0 commit comments

Comments
 (0)