Why my code is failing two test cases?
My code is :
CPP : Structurally Identical(Binary Tree)
@krishnakumarkrish,
Hello Krishna,
check this line
return checkifidentical(root1->left, root2->left);
return checkifidentical(root1->right,root2->right);
your second line will never run.
hint store results of checkifidentical(root1->left, root2->left); and checkifidentical(root1->right,root2->right); in some variable (say b1 and b2).
and then return true if b1 and b2 are true otherwise return false.