LeetCode226. Invert Binary Tree
2016-09-06 22:22
295 查看
Invert a binary tree.
4 / \ 2 7 / \ / \ 1 3 6 9to
4 / \ 7 2 / \ / \9 6 3 1解法:TreeNode* invertTree(TreeNode* root) {if(root==NULL)return NULL;TreeNode *temp;temp=root->left;root->left=temp;root->right=temp;invertTree(root->right);invertTree(root->left);return root;}
相关文章推荐
- leetcode记录 226. Invert Binary Tree
- <LeetCode OJ> 226. Invert Binary Tree
- LeetCode 226. Invert Binary Tree
- leetcode--Invert Binary Tree
- LeetCode:226. Invert Binary Tree
- Leetcode 226 Invert Binary Tree
- leetcode226: Invert Binary Tree
- LeetCode 226 Invert Binary Tree(转换二叉树)
- leetcode笔记:Invert Binary Tree
- LeetCode Invert Binary Tree
- LeetCode-Invert_Binary_Tree
- [leetcode]:Invert a binary tree.
- LeetCode 226 Invert Binary Tree
- leetcode 226. Invert Binary Tree
- LeetCode | Invert Binary Tree
- Leetcode 226[easy]---Invert Binary Tree(迭代入门题,tree-queue,stack 入门题,反复看)
- [LeetCode]--226. Invert Binary Tree
- [leetcode]226. Invert Binary Tree
- Leetcode_226 Invert Binary Tree
- Leetcode:226. Invert Binary Tree