Wrong Output Structurally Identical BT

I am getting false instead of true in this question for the sample test case given; Help required…

the link of my code:

@sanjit_15, your build function does’nt seems to be correct , also you have to check for structurally identical BT , there structure have to be same there data may change , so
in your identical function :-
instead of

if(root1->data==root2->data && identical(root1->left,root2->left) && identical(root1->right,root2->right))
			return true;

it should be

if( identical(root1->left,root2->left) && identical(root1->right,root2->right))
			return true;

corrected code :-

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.