def invert_tree_recursive(root):
    """
    Invert binary tree

    :param root: root node
    :type root: TreeNode
    :return: root node of inverted tree
    :rtype: TreeNode
    """
    # basic case
    if root is None:
        return None

    root.left, root.right = invert_tree_recursive(root.right), invert_tree_recursive(root.left)

    return root