struct TreeNode* mirrorTree(struct TreeNode* root){
if(root==NULL)
{
return NULL;
}
struct TreeNode*good=root->left;
root->left=root->right;
root->right=good;
mirrorTree(root->left);
mirrorTree(root->right);
return root;
}
力扣二叉树:翻转二叉树
最新推荐文章于 2024-09-15 15:43:59 发布