剑指 Offer 27. 二叉树的镜像
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; } }

我的前方是万里征途,星辰大海!!

浙公网安备 33010602011771号