Structurally identical binary tree

My code is giving wrong answer for the sample input case