Given a binary tree, check whether itis a mirror of itself (ie, symmetric aroundits center).
For example, this binary tree [1,2,2,3,4,4,3] is symmetric:
1
/ \
22
/ \ / \
3443
But the following [1,2,2,null,3,null,3] isnot:
1
/ \
22
\ \
33
Note:
Bonus points if you could solve it both recursively and iteratively.
提交反馈:
193 / 193 test cases passed.
Status: Accepted
Runtime:16 ms
Submitted:1 minute ago
You are here!
Your runtime beats 1.44 % of java submissions