From 489085727893bd53f281ed7bf48648082e3e9f1e Mon Sep 17 00:00:00 2001 From: CyC2018 Date: Fri, 30 Oct 2026 20:18:01 +0800 Subject: [PATCH] =?UTF-8?q?Update=2028.=20=E5=AF=B9=E7=A7=B0=E7=9A=84?= =?UTF-8?q?=E4=BA=8C=E5=8F=89=E6=A0=91.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 补充对称二叉树解法中关于两棵子树互为镜像判定的思路说明。 --- notes/28. 对称的二叉树.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/notes/28. 对称的二叉树.md b/notes/28. 对称的二叉树.md index bf955019..645b0870 100644 --- a/notes/28. 对称的二叉树.md +++ b/notes/28. 对称的二叉树.md @@ -10,6 +10,8 @@ ## 解题思路 +一棵树对称,等价于根的左右子树互为镜像。比较两棵子树 t1 和 t2 是否互为镜像:根的值相同,并且 t1 的左子树与 t2 的右子树互为镜像、t1 的右子树与 t2 的左子树互为镜像。 + ```java public boolean checkSymmetricTree(TreeNode root) { if (root == null)