大地瓜的博客

Home Archives
2017-03-14

Invert Binary Tree--leetcode

简单递归

func invertTree(root *TreeNode) *TreeNode {
    if(root==nil){return nil}
    temp:=TreeNode{}
    temp.Val=root.Val
    temp.Left=invertTree(root.Right)
    temp.Right=invertTree(root.Left)
    return &temp
}
Share
  • 算法
Newer
px2rem-vc code插件推荐
Older
Unique Binary Search Trees II--leetcode

标签

  • 3D
  • LeetCode
  • html
  • javascript
  • webgl
  • 算法
  • 算法, LeetCode

标签云

3D LeetCode html javascript webgl 算法 算法, LeetCode

归档

  • 四月 2022
  • 一月 2022
  • 二月 2021
  • 一月 2021
  • 十二月 2020
  • 六月 2019
  • 四月 2019
  • 三月 2019
  • 十二月 2018
  • 十一月 2018
  • 十月 2018
  • 九月 2018
  • 八月 2018
  • 七月 2018
  • 六月 2018
  • 五月 2018
  • 四月 2018
  • 三月 2018
  • 二月 2018
  • 一月 2018
  • 十二月 2017
  • 九月 2017
  • 八月 2017
  • 六月 2017
  • 五月 2017
  • 四月 2017
  • 三月 2017
  • 二月 2017
  • 一月 2017
  • 十二月 2016
  • 十一月 2016
  • 十月 2016
  • 九月 2016
  • 八月 2016
  • 七月 2016
  • 六月 2016
  • 五月 2016
  • 四月 2016
  • 三月 2016
  • 二月 2016
  • 一月 2016
  • 十二月 2015

最新文章

  • Hello World
  • 编译自己的chrome(一)
  • SameSite
  • ts复习
  • 用rust写前端(一)
© 2022 John Doe
Powered by Hexo
Home Archives