简单题ref“使用的是先序遍历,算法的复杂度跟遍历是一致的,如果使用递归,时间复杂度是O(n),空间复杂度是O(logn)。” by codegankerhttp://blog.csdn.net/linhuanmars/article/details/22839819?Time to search ...
分类:
其他好文 时间:
2015-06-10 06:32:13
阅读次数:
104
有个问题,就是不能和same tree一样光看root 做recursive而是必须比较左右节点,因为对称是指整个树否则就会出现 1 2 2 # 3 3public class Solution { public boolean isSymmetric(TreeNode root) { ...
分类:
其他好文 时间:
2015-06-10 06:31:42
阅读次数:
104
https://leetcode.com/problems/same-tree/Same TreeGiven two binary trees, write a function to check if they are equal or not.Two binary trees are consi...
分类:
编程语言 时间:
2015-05-16 18:07:57
阅读次数:
130
题目:Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical...
分类:
其他好文 时间:
2015-05-15 09:01:13
阅读次数:
145
Given two binary trees, write a function to check if they are equal or not.
Two binary trees are considered equal if they are structurally identical and the nodes have the same value.
分析:
题目要求判...
分类:
其他好文 时间:
2015-05-14 14:19:07
阅读次数:
124
Given two binary trees, write a function to check if they are equal or not.
Two binary trees are considered equal if they are structurally identical and the nodes have the same value.
基本思路:
进行递...
分类:
其他好文 时间:
2015-05-05 19:44:08
阅读次数:
107
题目Given two binary trees, write a function to check if they are equal or not.
分析写一个检查两个二叉树是否相等的函数...
分类:
其他好文 时间:
2015-05-04 22:16:06
阅读次数:
114
题目:Given two binary trees, write a function to check if they are equal or not.
Two binary trees are considered equal if they are structurally identical and the nodes have the same value.
解题思路:这题...
分类:
其他好文 时间:
2015-05-02 16:36:20
阅读次数:
104
题目:Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical...
分类:
其他好文 时间:
2015-05-02 16:32:51
阅读次数:
116
https://leetcode.com/problems/same-tree/Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equ...
分类:
其他好文 时间:
2015-05-02 13:38:23
阅读次数:
137