码迷,mamicode.com
首页 >  
搜索关键字:same-tree    ( 180个结果
[Leetcode][Tree][Same Tree]
非常简单的一道题/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x...
分类:其他好文   时间:2014-07-07 16:25:49    阅读次数:220
[LeetCode]Same Tree
[LeetCode]Same Tree...
分类:其他好文   时间:2014-07-02 11:51:25    阅读次数:195
leetcode - Same Tree
题目:Same TreeGiven two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally ...
分类:其他好文   时间:2014-06-15 00:53:09    阅读次数:314
[leetcode] 22.Same Tree
同是递归简单题public class Solution { public boolean isSameTree(TreeNode p, TreeNode q) { boolean flag = true; if(p == null && q == null) ...
分类:其他好文   时间:2014-06-09 13:46:23    阅读次数:275
LeetCode: Same Tree [100]
【题目】 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-06-02 11:03:03    阅读次数:205
[leetcode]Same Tree @ Python
原题地址:https://oj.leetcode.com/problems/same-tree/题意:判断两棵树是否是同一棵树。解题思路:这题比较简单。用递归来做。首先判断两个根节点的值是否相同,如果相同,递归判断根的左右子树。代码:# Definition for a binary tree n....
分类:编程语言   时间:2014-05-26 10:30:17    阅读次数:289
LeetCode OJ - Same Tree
题目: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...
分类:其他好文   时间:2014-05-23 12:40:21    阅读次数:352
Leetcode:Same Tree
戳我去解题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...
分类:其他好文   时间:2014-05-20 10:09:37    阅读次数:201
Leetcode 树 Same Tree
本文为senlie原创,转载请保留此地址:http://blog.csdn.net/zhengsenlie Same Tree  Total Accepted: 15922 Total Submissions: 38418 Given two binary trees, write a function to check if they are equal o...
分类:其他好文   时间:2014-05-14 01:15:40    阅读次数:293
LeetCode OJ - Symmetric Tree && Same Tree
这两道题,大同小异。 我都是用BFS,在遍历的过程,判断结构是否相同/对称,值是否相同。下面是AC代码: 1 /** 2 * Given a binary tree, check whether it is a mirror of itself (ie, symmetric aroun...
分类:其他好文   时间:2014-05-05 09:48:26    阅读次数:401
180条   上一页 1 ... 16 17 18
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!