思路:运用递归的思想 public class Solution { public TreeNode mirrorTree(TreeNode root) { // 思路是交换左右子树 即可 if (root == null) return null; TreeNode tmp = root.left; root.left = mirrorTree(root.right); root.right = mirrorTree(tmp); return root; } }