From 9fdaeb5b9075ed5195e828d9426c1dd98a7212ec Mon Sep 17 00:00:00 2001 From: Vox Dai Date: Sun, 21 Apr 2024 09:16:13 +0800 Subject: [PATCH] =?UTF-8?q?Update=200111.=E4=BA=8C=E5=8F=89=E6=A0=91?= =?UTF-8?q?=E7=9A=84=E6=9C=80=E5=B0=8F=E6=B7=B1=E5=BA=A6.md=20/=20Fix=20ty?= =?UTF-8?q?po?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 部分Markdown代码块没有标注语言导致代码没有高亮 --- problems/0111.二叉树的最小深度.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/problems/0111.二叉树的最小深度.md b/problems/0111.二叉树的最小深度.md index 6d1632d5..9619b75b 100644 --- a/problems/0111.二叉树的最小深度.md +++ b/problems/0111.二叉树的最小深度.md @@ -64,7 +64,7 @@ 代码如下: -``` +```CPP int getDepth(TreeNode* node) ``` @@ -74,14 +74,14 @@ int getDepth(TreeNode* node) 代码如下: -``` +```CPP if (node == NULL) return 0; ``` 3. 确定单层递归的逻辑 这块和求最大深度可就不一样了,一些同学可能会写如下代码: -``` +```CPP int leftDepth = getDepth(node->left); int rightDepth = getDepth(node->right); int result = 1 + min(leftDepth, rightDepth);