class Solution { public TreeNode mirrorTree(TreeNode root) { if(root == null) return null; TreeNode temp = root.left; root.left = root.right; root.right = temp; mirrorTree(root.left); mirrorTree(root.right); return root; } }
剑指 Offer 27. 二叉树的镜像
我的前方是万里征途,星辰大海!!