
Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Which approach is better here- recursive or iterative?
If recursive approach is better, can you write recursive function with its parameters?
Two trees <b>s</b> and <b>t</b> are said to be identical if their root values are same and their left and right subtrees are identical. Can you write this in form of recursive formulae?
Recursive formulae can be: isIdentical(s,t)= s.val==t.val AND isIdentical(s.left,t.left) AND isIdentical(s.right,t.right)