Structurally Identical (Binary Tree)


plz check my build function plz plz

true and false, when provided as input, are strings and not Boolean values
so change “bool” to “string” in line 24
Remove lines 28 29, why are you returning NULL if(b == “false”), you don’t need to return anything.
The only thing is if(b == “true”) then build tree on the left of the root
else don’t build on the left
Similarly remove lines 33 and 34

In line 46 (if(root1 != NULL && root2 != NULL) || if(root1 == NULL && root2 == NULL)) && checkifidentical(root1->left, root2->left)…

When you pass root1->left as a parameter you don’t check if root1 != NULL
if root1 is NULL then root1->left doesn’t exist

you cannot apply -> on a variable which is NULL