感觉是个后序遍历
class Solution { public: void Mirror(TreeNode *pRoot){ if(pRoot==NULL)return ; Mirror(pRoot->left); Mirror(pRoot->right); //下边代码原来是visit(); TreeNode *temp=pRoot->left; pRoot->left=pRoot->right; pRoot->right=temp; } };
感觉是个后序遍历
class Solution { public: void Mirror(TreeNode *pRoot){ if(pRoot==NULL)return ; Mirror(pRoot->left); Mirror(pRoot->right); //下边代码原来是visit(); TreeNode *temp=pRoot->left; pRoot->left=pRoot->right; pRoot->right=temp; } };