class Solution
{
public:
bool isSameTree(TreeNode* root1, TreeNode* root2)
{
if (root1 == NULL && root2 == NULL)
return true;
else if (root1 == NULL || root2 == NULL)
return false;
else
{
if (root1->val == root2->val)
return isSameTree(root1->left, root2->left)
& isSameTree(root1->right, root2->right);
else
return false;
}
}
};