题解 | #二叉树的镜像#
二叉树的镜像
http://www.nowcoder.com/practice/a9d0ecbacef9410ca97463e4a5c83be7
typedef struct TreeNode Node;
struct TreeNode* Mirror(struct TreeNode* pRoot ) {
Node* tmp = pRoot;
Node* tmp1;
if (!tmp)
return NULL;
tmp1 = tmp->left;
tmp->left = tmp->right;
tmp->right = tmp1;
Mirror(pRoot->left);
Mirror(pRoot->right);
return tmp;
}