leetcode 226. Invert Binary Tree
来源:互联网 发布:json对象是什么意思 编辑:程序博客网 时间:2024/06/04 20:43
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */class Solution {public: void swap1(TreeNode*root){ if(root == NULL) return; swap(root->left,root->right); swap1(root->left); swap1(root->right); } TreeNode* invertTree(TreeNode* root) { swap1(root); return root; }};
0 0
- LeetCode 226. Invert Binary Tree
- [leetcode] 226.Invert Binary Tree
- [leetcode] 226. Invert Binary Tree
- 【LeetCode】226. Invert Binary Tree
- leetCode 226. Invert Binary Tree
- LeetCode #226. Invert Binary Tree
- [LeetCode]226. Invert Binary Tree
- 226. Invert Binary Tree LeetCode
- LeetCode 226. Invert Binary Tree
- LeetCode 226. Invert Binary Tree
- leetcode:226. Invert Binary Tree
- LeetCode 226. Invert Binary Tree
- [LeetCode]226. Invert Binary Tree
- leetcode 226. Invert Binary Tree
- 【LeetCode】226. Invert Binary Tree
- #leetcode#226. Invert Binary Tree
- LeetCode *** 226. Invert Binary Tree
- leetcode: 226. Invert Binary Tree
- LeetCode:Binary Tree Paths
- MyBatis基础(二)—持久层开发的两种方法
- CentOS7安装docker1.9.1及简单使用
- 统计学好书推荐
- android ffmpeg移植编译错误汇总
- leetcode 226. Invert Binary Tree
- Andrew Ng机器学习之一 导论
- Problem A
- 变量声明的意义
- 第25课:Spark Streaming的StreamingContext启动及JobScheduler启动源码图解
- C 语言
- Leetcode 11. Container With Most Water
- WebApi使用
- dhcpd usage