leetcode 226. Invert Binary Tree
TreeNode* invertTree(TreeNode* root) { if (root == NULL) return NULL; auto temp = root->left; root->left = root->right; root->right = temp; invertTree(root->left); invertTree(root->right); return root; }
【本文章出自博客园willaty,转载请注明作者出处,误差欢迎指出~】