Easy Self Explanatory Solution


#1
int Solution::isSameTree(TreeNode* A, TreeNode* B) {
if(A == NULL || B == NULL)
    return A == B ? 1 : 0;
if(A->val == B->val)
    return isSameTree(A->left,B->left) && isSameTree(A->right, B->right);
 else return 0;  

}