# 对称二叉树 (Symmetric Tree) ## 题目描述 给你一个二叉树的根节点 root,检查它是否轴对称。 ## 解题思路 ### 递归比较 ## Go 代码 ```go func isSymmetric(root *TreeNode) bool { return check(root.Left, root.Right) } func check(left, right *TreeNode) bool { if left == nil && right == nil { return true } if left == nil || right == nil { return false } return left.Val == right.Val && check(left.Left, right.Right) && check(left.Right, right.Left) } ``` **复杂度:** O(n) 时间,O(h) 空间