https://ide.codingblocks.com/s/106647 server loaction where you can find the problem
Structurally Identical (Binary Tree) one test case is failing the 3rd one idk why its showing wrong answer
Hello @sonishivam417,
I guess, you have not understood the problem completely.
You are required to check if the trees are structurally identical or not.
Example 1:
10 true 20 true 40 false false true 50 false false true 30 true 60 false false true 73 false false
10 true 20 true 40 false false true 50 false false true 30 true 53 false false true 73 false false
Example 2:
10 true 20 true 40 false false true 50 false false true 30 true 60 false false true 73 false false
10 true 20 true 40 false false true 50 false false true 30 true 60 false false true 73 false false
Both are structurally identical. But your code returns false for first and true for second.
Solution:
Don’t compare the values of nodes.
Hope, this would help.
Give a like if you are satisfied.
Thanks a lot i did the required changes.
Mark this doubt as resolved, if you have no more issues regarding this problem.
BTW I won’t mind a like.