[leetcode] 101. Symmetric Tree 解题报告

题目链接:https://leetcode.com/problems/symmetric-tree/

Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).

For example, this binary tree is symmetric:

    1
   / \
  2   2
 / \ / \
3  4 4  3

But the following is not:

    1
   / \
  2   2
   \   \
   3    3


思路:将左子树先遍历左子树,右子树先遍历右子树,看其是否相等即可!要注意判空!

今天去laurence买了一把epiphone dove pro吉他,好久没弹过了,手好痛啊。可怜


你可能感兴趣的:(LeetCode,算法,二叉树,tree,binary,DFS)