can you provide me test case 1 input
What is test case 1 input
your code is correct but don’t compare the node data. As mentioned in the question They may or may not have the same data though. We don’t need to compare node data. Only tree structure.
So in your return statement only do:
return structurallyIdentical(tnode.left,onode.left)
&& structurallyIdentical(tnode.right,onode.right);
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.