lc.226 翻转二叉树
1
2
3
4
5
6
7
TreeNode* invertTree(TreeNode* root) {
if (root == NULL) return root;
swap(root->left, root->right); // 中
invertTree(root->left); // 左
invertTree(root->right); // 右
return root;
}
This post is licensed under CC BY 4.0 by the author.

