Let us create trees in above example 1
root1 = Node ( 1 ) NEW_LINE root1 . left = Node ( 2 ) NEW_LINE root1 . right = Node ( 3 ) NEW_LINE root1 . left . left = Node ( 4 ) NEW_LINE root1 . right . left = Node ( 6 ) NEW_LINE root1 . right . right = Node ( 7 ) NEW_LINE root2 = Node ( 0 ) NEW_LINE root2 . left = Node ( 1 ) NEW_LINE root2 . right = Node ( 5 ) NEW_LINE root2 . left . right = Node ( 4 ) NEW_LINE root2 . right . left = Node ( 6 ) NEW_LINE root2 . right . right = Node ( 7 ) NEW_LINE if ( isSame ( root1 , root2 ) ) : NEW_LINE INDENT print ( " Same " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Not ▁ Same " ) NEW_LINE DEDENT