Structurally Identical (Binary Tree)

why my code is failing for first 2 test cases??
code link:- https://ide.codingblocks.com/s/327316

@sourav_817, you are not supposed to take n in input , also you are not supposed to this question this way , you might be able to solve this but the purpose of the question is for you to devise algorithm for a tree , what you need to do is form two trees from the input given then check if they are stucturally identical or not ,
refer this for hint :-

1 Like

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.