标签:
1 /** 2 public class TreeNode { 3 int val = 0; 4 TreeNode left = null; 5 TreeNode right = null; 6 7 public TreeNode(int val) { 8 this.val = val; 9 10 } 11 12 } 13 */ 14 public class Solution { 15 public void Mirror(TreeNode root) { 16 if(root==null){ 17 return ; 18 } 19 TreeNode temp ; 20 temp = root.left ; 21 root.left = root.right ; 22 root.right = temp ; 23 Mirror(root.left) ; 24 Mirror(root.right) ; 25 } 26 }
标签:
原文地址:http://www.cnblogs.com/huntertoung/p/4777278.html