We can solve the answer through recursion. At each step we check if the parent element are equals or not & their left and right child are equals or not.
def sameTree(t1, t2):
if t1 is None and t2 is None:
return True
return sameTree(t1.root, t2.root) and sameTree(t1.left, t2.left) and sameTree(t1.right, t2.right)