题目链接链接: 翻转二叉树题目要求给你一棵二叉树的根节点 root 翻转这棵二叉树并返回其根节点。解题思路使用后序遍历递归反转当前根节点的左子树递归反转当前根节点的右子树交换当前根节点左子树和右子树递归的结束条件 root null代码实现classSolution{publicTreeNodeinvertTree(TreeNoderoot){if(rootnull){returnnull;}TreeNodeleftinvertTree(root.left);TreeNoderightinvertTree(root.right);root.leftright;root.rightleft;returnroot;}}