Structurally identical Binary Trees


failing two testcases. Why?

hi @akankshaanand99 this code is returning true always, even when the trees are not identical.
for eg
50 true 290 true 23 false false false true 78 true 66 false false false
10 true 20 true 40 false false true 50 false false true 30 true 60 false false true 73 false true 88 false false

I tried making a few changes in my code but it still didn’t work. Can you see where the problem is?

hi @akankshaanand99 your checkidentical function is correct. the problem is with build function, you need to pass root by reference. i made the changes here https://ide.codingblocks.com/s/213132

Oh thank you, a very minor mistake I wasn’t able to locate!

@akankshaanand99 please mark the doubt as resolved :slight_smile: