From ea91e3a70058ad212bce38977df5e6f1dd68deaa Mon Sep 17 00:00:00 2001 From: CyC2018 Date: Wed, 28 Oct 2026 13:45:06 +0800 Subject: [PATCH] =?UTF-8?q?Update=2055.1=20=E4=BA=8C=E5=8F=89=E6=A0=91?= =?UTF-8?q?=E7=9A=84=E6=B7=B1=E5=BA=A6.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 题目链接改为力扣中的对应题目,题目描述和代码按该题的接口调整。 --- notes/55.1 二叉树的深度.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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)); } ```