101.Symmetric Tree
101. Symmetric Tree
題目描述
Given the root
of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center).
範例
Example 1:
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Example 2:
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Constraints:
- The number of nodes in the tree is in the range [1, 1000].
- -100 <=
Node.val
<= 100
Follow up: Could you solve it both recursively and iteratively?
解答
Python
Ron ChenMon, Mar 13, 2023
Javascript
MarsgoatMon, Mar 13, 2023
Reference
回到題目列表