diff --git a/notes/55.1 二叉树的深度.md b/notes/55.1 二叉树的深度.md index 81d9e394..09c7434f 100644 --- a/notes/55.1 二叉树的深度.md +++ b/notes/55.1 二叉树的深度.md @@ -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)); } ```