https://leetcode.com/problems/same-tree/ 1 /** 2 * Definition for a binary tree node. 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * TreeN
分类:
编程语言 时间:
2016-03-05 21:43:42
阅读次数:
179
判断一棵树是否自对称 可以回忆我们做过的Leetcode 100 Same Tree 二叉树和Leetcode 226 Invert Binary Tree 二叉树 先可以将左子树进行Invert Binary Tree,然后用Same Tree比较左右子树 而我的做法是改下Same Tree的函数
分类:
其他好文 时间:
2016-03-01 20:45:19
阅读次数:
148
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 a
分类:
编程语言 时间:
2016-02-27 06:20:29
阅读次数:
165
/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */
分类:
其他好文 时间:
2016-02-17 00:52:29
阅读次数:
168
废话不多说。直接上代码,哈哈,痛快: /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : va
分类:
其他好文 时间:
2016-01-28 19:17:22
阅读次数:
121
就是判断两棵树的值和结构是否相同注意:要判断是否所有的树节点是否为NULL 1 /** 2 * Definition for a binary tree node. 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; ...
分类:
其他好文 时间:
2016-01-16 19:23:21
阅读次数:
135
翻译给定两个二叉树,写一个函数检查他们是否相等。两个二叉树如果结构上相同并且有相同的值,那么就认定他们是相等的。原文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 ident...
分类:
其他好文 时间:
2016-01-11 14:07:08
阅读次数:
135
题目: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...
分类:
其他好文 时间:
2016-01-10 10:28:58
阅读次数:
144
题目的意思很简单,判断两棵树是否相同,递归,对两棵树的结点进行比较即可。...
分类:
其他好文 时间:
2015-12-27 12:15:34
阅读次数:
186
题目描述: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 identic...
分类:
编程语言 时间:
2015-12-23 16:09:44
阅读次数:
292