码迷,mamicode.com
首页 >  
搜索关键字:same-tree    ( 180个结果
OJ练习21——T100 Same Tree
遇到树了!终于看起来高大上一点了= =比较两棵二叉树,相等则返回true。【思路】递归,if(p->val==q->val&&isSameTree(p->left,q->left)&&isSameTree(p->right,q->right)) return true.注意还要考虑特殊情况。【my ...
分类:其他好文   时间:2015-04-21 09:31:31    阅读次数:193
【leetcode】Same Tree(easy)
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 an...
分类:其他好文   时间:2015-04-17 15:23:15    阅读次数:107
LeetCode --- 100. Same Tree
题目链接: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 and the nodes have the same value....
分类:其他好文   时间:2015-04-14 21:41:41    阅读次数:140
leetcode——Same Tree (二叉树的递归-先序遍历)
Same TreeTotal Accepted:56263Total Submissions:133912My SubmissionsQuestionSolutionGiven two binary trees, write a function to check if they are equal...
分类:其他好文   时间:2015-04-14 11:07:01    阅读次数:110
Same Tree
判断两棵树是否对称 class Solution {public: bool isSameTree(TreeNode *p, TreeNode *q) { if (!p && !q) return true; if (p && !q) return false; if (!p && q) ...
分类:其他好文   时间:2015-04-11 11:40:44    阅读次数:113
【LeetCode从零单刷】Same Tree
从今天起,模仿《从零单排》系列,菜鸡单刷LeetCode!...
分类:其他好文   时间:2015-04-07 21:46:39    阅读次数:149
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 and the nodes have the same value....
分类:其他好文   时间:2015-04-07 11:59:15    阅读次数:128
leetcode|100|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 and the nodes have the same value. 判断两棵二叉树是否相同。...
分类:其他好文   时间:2015-04-03 09:18:52    阅读次数:138
LeetCode Same Tree
Same Tree Total Accepted: 52651 Total Submissions: 125166 My Submissions Question Solution Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered e...
分类:其他好文   时间:2015-03-20 23:50:46    阅读次数:166
【LeetCode】 Same Tree
题目:Same Tree /** * LeetCode Same Tree * 题目:判断两棵树是否是完全相同的 * 思路:完全相同:1、结构相同; * 2、值相同。 * Definition for binary tree * public class TreeNode { * int val; * TreeNode left; * ...
分类:其他好文   时间:2015-03-17 20:14:14    阅读次数:127
180条   上一页 1 ... 11 12 13 14 15 ... 18 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!