def invert_tree(root):
 if (root == None):
  return None
 temp = root.right
 root.right = root.left
 root.left = temp
 invert_tree(root.left)
 invert_tree(root.right)
 return root

def invert_tree ( root ) : if ( root == None ) : return None temp = root . right root . right = root . left root . left = temp invert_tree ( root . left ) invert_tree ( root . right ) return root
inverts a binary tree .