LeetCode100. Same Tree
Given two binary trees, write a function to check if they are the same or not.
Two binary trees are considered the same if they are structurally identical and the nodes have the same value.
就是说只有完全相同的两棵二叉树才返回true。
思路很简单,遍历一下二叉树就好了……这里用的是先序遍历,先看根节点是否满足条件,再查看其左子树与柚子树。