Update 27. 二叉树的镜像.md

题目链接改为力扣中的对应题目,题目描述和代码按该题的接口调整。
This commit is contained in:
CyC2018
2026-10-28 13:45:04 +08:00
parent d5cb5fbc31
commit c863a8a23d
+4 -4
View File
@@ -1,6 +1,6 @@
# 27. 二叉树的镜像
[牛客网](https://www.nowcoder.com/practice/a9d0ecbacef9410ca97463e4a5c83be7?tpId=13&tqId=11171&tab=answerKey&from=cyc_github)
[Leetcode](https://leetcode.cn/problems/er-cha-shu-de-jing-xiang-lcof/)
## 题目描述
@@ -9,12 +9,12 @@
## 解题思路
```java
public TreeNode Mirror(TreeNode root) {
public TreeNode flipTree(TreeNode root) {
if (root == null)
return root;
swap(root);
Mirror(root.left);
Mirror(root.right);
flipTree(root.left);
flipTree(root.right);
return root;
}