/** * Definition for binary tree * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */bool isSameTree(...
分类:
其他好文 时间:
2015-03-10 22:44:42
阅读次数:
144
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-03-10 16:57:12
阅读次数:
121
题目1.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 identical and the nodes have the same value.2.sym...
分类:
其他好文 时间:
2015-03-02 16:51:53
阅读次数:
135
欢迎大家阅读参考,如有错误或疑问请留言纠正,谢谢
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 ...
分类:
其他好文 时间:
2015-02-16 14:19:42
阅读次数:
98
原题地址基本模拟题代码:1 bool isSameTree(TreeNode *p, TreeNode *q) {2 if (p && q)3 return p->val == q->val && isSameTree(p->left, q->left) &&...
分类:
其他好文 时间:
2015-02-02 12:19:56
阅读次数:
82
#pragma once
#include
#include
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
bool isSameTree(TreeNode...
分类:
其他好文 时间:
2015-01-30 09:11:06
阅读次数:
214
题目链接:https://oj.leetcode.com/problems/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 i...
分类:
其他好文 时间:
2015-01-30 09:07:15
阅读次数:
177
/************************************************************************/ /* 36: Same Tree */ /****************************************************.....
分类:
其他好文 时间:
2015-01-27 23:14:26
阅读次数:
195
https://oj.leetcode.com/problems/same-tree/Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered ...
分类:
其他好文 时间:
2015-01-13 14:14:55
阅读次数:
125