input: def is_similar_tree(root1: TreeNode, root2: TreeNode) -> bool:
      """
      Compare two binary trees to check if they are similar by comparing their node values and structure.
      
      >>> tree1 = TreeNode(1)
      >>> tree1.left = TreeNode(2)
      >>> tree1.right = TreeNode(3)
      
      >>> tree2 = TreeNode(1)
      >>> tree2.left = TreeNode(2)
      >>> tree2.right = TreeNode(3)
      
      >>> is_similar_tree(tree1, tree2)
      True
      
      >>> tree3 = TreeNode(1)
      >>> tree3.left = TreeNode(3)
      >>> tree3.right = TreeNode(2)
      
      >>> is_similar_tree(tree1, tree3)
      False
      """
output:     if not root1 and not root2:
          return True
      if not root1 or not root2:
          return False
      if root1.val != root2.val:
          return False
      return is_similar_tree(root1.left, root2.left) and is_similar_tree(root1.right, root2.right)