Symmetric Tree Axis Checker
Problem Description
Given the root of a binary tree, determine whether the tree is **symmetric around its central axis** — that is, whether the left subtree is a mirror reflection of the right subtree.
**Example 1:**
```
6
/ \
3 3
/ \ / \
1 4 4 1
```
Input: root = [6,3,3,1,4,4,1]
Output: true
Explanation: The tree is a perfect mirror: left side [3,1,4] mirrors right side [3,4,1].
**Example 2:**
```
9
/ \
2 2
\ \
7 7
```
Input: root = [9,2,2,null,7,null,7]
Output: false
Explanation: The right child of node 2 (left subtree) should mirror the left child of node 2 (right subtree), but both are null on left and 7 on right.
Constraints
- The number of nodes is in the range [1, 10^4].
- Node values are integers in the range [-50, 50].
- The root is always non-null.
Follow-up
Can you solve this iteratively using a queue, processing node pairs level by level?
Hints
Try the problem first. If you get stuck, you can reveal hints one at a time.
Solution
Leaderboard
No entries yet for python.
Be the first — submit an accepted solution.