给定两个二叉树,编写一个函数来检查它们是否相等或为空树。 如果两个二叉树被认为是相等的,那么它们在结构上是相同的,并且任意节点具有相同的值。...
分类:
其他好文 时间:
2014-10-04 00:12:55
阅读次数:
219
题目:
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.
刷题打卡中...
分类:
其他好文 时间:
2014-09-18 16:33:24
阅读次数:
205
问题描述
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.
解决...
分类:
其他好文 时间:
2014-09-01 15:40:33
阅读次数:
146
问题:判断两棵二叉树是否相等class Solution {public: bool isSameTree(TreeNode *p, TreeNode *q) { if(!( (p && q && p->val==q->val) || (p==NULL && q==NULL)))...
分类:
其他好文 时间:
2014-08-01 22:58:12
阅读次数:
195
问题描述:
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.
解题思路:...
分类:
其他好文 时间:
2014-08-01 13:48:11
阅读次数:
183
题目: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 identica....
分类:
编程语言 时间:
2014-07-31 02:24:15
阅读次数:
211
语言:Python描述:使用递归实现 1 # Definition for a binary tree node 2 # class TreeNode: 3 # def __init__(self, x): 4 # self.val = x 5 # self...
分类:
其他好文 时间:
2014-07-09 20:46:34
阅读次数:
168