LintCode 469-等价二叉树
来源:互联网 发布:下载word2010软件 编辑:程序博客网 时间:2024/05/18 00:43
本人电子系,只为一学生。心喜计算机,小编以怡情。
public boolean isIdentical(TreeNode a, TreeNode b) { // Write your code here if(a!=null && b!=null){ boolean m=isIdentical(a.left,b.left); boolean n=isIdentical(a.right,b.right); //后序遍历 if(a.val!=b.val)//如果值不等,直接返回错 return false; else//否则看看左右子树返回的是对是错 return m&&n; } else if(a!=null || b!=null){ return false; } else{ return true; } }
阅读全文
0 0
- lintcode 469 等价二叉树
- LintCode 469-等价二叉树
- [Lintcode] #469 等价二叉树
- LintCode:等价二叉树
- lintcode ----等价二叉树
- 等价二叉树-lintcode
- 等价二叉树,lintcode
- lintcode-->等价二叉树
- lintcode,等价二叉树
- LintCode-等价二叉树
- LIntCode 等价二叉树
- 等价二叉树-LintCode
- Lintcode 等价二叉树
- LintCode 等价二叉树
- 等价二叉树-LintCode
- lintCode(469)——等价二叉树
- LintCode - 469.等价二叉树
- [LintCode]469.等价二叉树
- CSU 1326: The contest(并查集+分组背包)
- pandas中shift和diff函数关系
- 【算法题】疯狂的队列
- ZOJ
- 温度计式的时间进度(前端样式)
- LintCode 469-等价二叉树
- mybatis框架之 log4j.properties 的配置
- 计算三个班同学的总成绩,并升序排列
- 十年过去了,各位 .net 兄弟还好吗
- python中的异常处理 try..except
- hadoop2.x之IO:序列化
- lintcode--x的平方根
- CSS中的选择器
- CSU 1598: 最长公共前缀(KMP)