CodeCollection2018
9/12/2019 - 8:58 AM

Same Tree

public boolean isSameTree(TreeNode root1,TreeNode root2){
  if(root1==root2==null) return true;
  if(root1!=root2) return false;
  else return isSameTree(root1.left,root2.left)&&isSameTree(root1.right,root2.right);
}