题解 | #二叉树的镜像#
二叉树的镜像
http://www.nowcoder.com/practice/a9d0ecbacef9410ca97463e4a5c83be7
void Exchange(TreeNode*& T) { TreeNode* temp; if(T) { temp=T->left; T->left=T->right; T->right=temp; Exchange(T->left); Exchange(T->right); } } class Solution { public: TreeNode* Mirror(TreeNode* pRoot) { Exchange(pRoot); return pRoot; } };