LeeCode Invert Binary Tree
来源:互联网 发布:数据分析师未来前景 编辑:程序博客网 时间:2024/06/14 11:57
/** * Definition for a binary tree node. * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */struct TreeNode* invertTree(struct TreeNode* root) { struct TreeNode* temp; if(root==NULL) return NULL; else{ invertTree(root->left); invertTree(root->right); temp=root->left; root->left= root->right; root->right = temp; return root; } }struct TreeNode* invertTree(struct TreeNode* root) { struct TreeNode* temp; if(root==NULL) retrun NULL; else{ invertTree(root->left); invertTree(root->right); temp=root->left; root->left=root->right; root->right=temp; return root; }}
灵异事件,上下两端代码未发现任何不同,但是上面的能编译通过,而下面的不行。
C语言。
2016/1/28
0 0
- LeeCode Invert Binary Tree
- LeeCode-Invert Binary Tree
- [leetcode] Invert Binary Tree
- [LeetCode]Invert Binary Tree
- Invert Binary Tree
- leetcode:Invert Binary Tree
- Invert Binary Tree
- LeetCode Invert Binary Tree
- 226Invert Binary Tree
- LeetCode | Invert Binary Tree
- leetcode--Invert Binary Tree
- [leetcode] Invert Binary Tree
- [LeetCode] Invert Binary Tree
- LeetCode Invert Binary Tree
- Invert Binary Tree
- leetcode : Invert Binary Tree
- 226Invert Binary Tree
- Invert Binary Tree
- leetcode刷题系列C++-Search in Rotated Sorted Array
- 测试一下
- selenium之二
- JAVA的23中涉及模式详解
- Android中程序与Service交互的方式——交互方式
- LeeCode Invert Binary Tree
- 三分钟了解mongodb
- grunt 学习
- PullToRefresh使用详解(一)--构建下拉刷新的listView
- NYOJ-22-素数求和问题
- C、C++和MFC中文件的操作
- Android网络编程之Http请求服务器数据(POST方式)
- method_swizzling
- mac 安装问题汇总