首页 > 其他 > 详细

LeetCode Invert Binary Tree

时间:2015-06-13 11:26:09      阅读:166      评论:0      收藏:0      [点我收藏+]

LeetCode Invert Binary Tree

题目

技术分享

思路

没什么思路可言;
真不敢相信他写不出;

代码

struct TreeNode* invertTree(struct TreeNode* root) {
    if (root == NULL) return root;
    invertTree(root->left);
    invertTree(root->right);
    struct TreeNode * temp = root->left;
    root->left = root->right;
    root->right = temp;
    return root;
}

LeetCode Invert Binary Tree

原文:http://blog.csdn.net/u012925008/article/details/46480645

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!