二叉树的镜像
二叉树的镜像
http://www.nowcoder.com/questionTerminal/a9d0ecbacef9410ca97463e4a5c83be7
//解题思路: //左右子节点互换,然后递归就ok了 public TreeNode Mirror (TreeNode pRoot) { if(pRoot == null) { return null; } TreeNode temp = pRoot.left; pRoot.left = pRoot.right; pRoot.right = temp; Mirror(pRoot.left); Mirror(pRoot.right); return pRoot; }