LeetCode OJ:Same Tree
来源:互联网 发布:VMware怎么不能用mac 编辑:程序博客网 时间:2024/06/06 13:00
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.
class Solution {public: bool isSameTree(TreeNode *p, TreeNode *q) { if(p==NULL&&q==NULL)return true; if(p==NULL||q==NULL||p->val!=q->val)return false; return isSameTree(p->left,q->left)&&isSameTree(p->right,q->right); }};
0 0
- [LeetCode OJ]Same Tree
- LeetCode OJ:Same Tree
- LeetCode OJ - Same Tree
- [LeetCode OJ]Same Tree
- LeetCode OJ Same Tree
- 【LeetCode OJ 100】Same Tree
- <LeetCode OJ> 100. Same Tree
- [leetcode oj 100]Same Tree
- LeetCode OJ-100. Same Tree
- LeetCode Same Tree OJ 算法 刷题
- LeetCode oj 100. Same Tree (DFS||BFS)
- Leetcode - Tree - Same Tree
- [leetcode][tree] Same Tree
- LeetCode OJ 之 Same Tree (相同树的判断)
- LeetCode: Same Tree
- LeetCode Same Tree
- [Leetcode] Same Tree
- LeetCode : Same Tree
- mysql 无法启动
- TSF 在Win 8.1下的问题处理(未写完)
- 黑马程序员_java第八天基础总结
- shell技巧之多行改写成一行
- GCD之dispatch queue深入浅出
- LeetCode OJ:Same Tree
- (完整版)原因可能是堆被损坏,这也说明 中或它所加载的任何DLL 中有bug】的解决
- android 点击EditTextView不弹出输入法
- Android混淆
- CAS SSO研究一:抛弃Https让Cas以Http协议提供单点登录服务
- 结构体定义 typedef struct 用法详解和用法小结
- 2014年1月22日 14:01:28
- openerp开发ORM对象基本信息
- Yii 框架中应用 redis 数据库