翻转二叉树
来源:互联网 发布:php oa 工作流引擎 编辑:程序博客网 时间:2024/06/16 09:03
class Solution {public: /** * @param root: a TreeNode, the root of the binary tree * @return: nothing */ void look(TreeNode *root) { if(root==NULL) return ; if(root->left==NULL&&root->right==NULL) return; TreeNode *x; x=new TreeNode; x=root->left; root->left=root->right; root->right=x; look(root->left); look(root->right); } void invertBinaryTree(TreeNode *root) { look(root); // write your code here }};
0 0
- C++二叉树翻转
- 翻转二叉树
- 翻转二叉树
- 题目:翻转二叉树
- LintCode 翻转二叉树
- LinkCode-翻转二叉树
- 翻转二叉树
- 翻转二叉树
- 翻转二叉树
- LintCode_175_翻转二叉树
- 二叉树翻转
- lintcode ----翻转二叉树
- lintcode,翻转二叉树
- 翻转二叉树
- 翻转二叉树
- 翻转二叉树
- 翻转二叉树
- LintCode-翻转二叉树
- 将二叉树拆成链表
- [2017.4.19]IMWEB前端小白训练营日记(五)
- 初学Hibernate,从建立项目,配置文件到实现对单表的增删改查
- XMU 1606 nc与滴水问题 【模拟】
- hiho Coder hiho字符串
- 翻转二叉树
- 练习
- python装饰器
- 漫谈千亿级数据优化实践:数据倾斜(纯干货)
- python Image库
- CAS实现单点登入(二):自定义的用户验证登入
- 数码管
- 子树
- [2017.4.20]IMWEB前端小白训练营日记(六)