Update 55.1 二叉树的深度.md

题目链接改为力扣中的对应题目,题目描述和代码按该题的接口调整。
This commit is contained in:
CyC2018
2026-10-28 13:45:06 +08:00
parent c8007a5794
commit ea91e3a700
+3 -3
View File
@@ -1,6 +1,6 @@
# 55.1 二叉树的深度
[NowCoder](https://www.nowcoder.com/practice/435fb86331474282a3499955f0a41e8b?tpId=13&tqId=11191&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
[Leetcode](https://leetcode.cn/problems/er-cha-shu-de-shen-du-lcof/)
## 题目描述
@@ -11,7 +11,7 @@
## 解题思路
```java
public int TreeDepth(TreeNode root) {
return root == null ? 0 : 1 + Math.max(TreeDepth(root.left), TreeDepth(root.right));
public int calculateDepth(TreeNode root) {
return root == null ? 0 : 1 + Math.max(calculateDepth(root.left), calculateDepth(root.right));
}
```