226. Invert Binary Tree--LeetCode Record
来源:互联网 发布:python mysql 回滚 编辑:程序博客网 时间:2024/06/05 23:48
/** * Definition for a binary tree node. * public class TreeNode { * public var val: Int * public var left: TreeNode? * public var right: TreeNode? * public init(_ val: Int) { * self.val = val * self.left = nil * self.right = nil * } * } */class Solution { func invertTree(root: TreeNode?) -> TreeNode? { if root == nil { return nil } let swapNode = invertTree(root?.left) root?.left = invertTree(root?.right) root?.right = swapNode return root }}
0 0
- 226. Invert Binary Tree--LeetCode Record
- 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
- E45: 'readonly' option is set (add ! to override)
- hdu 1175 连连看(DFS)
- iOS开发中加载图片的内存问题以及优化方案
- 模糊搜索
- 搭建python3环境
- 226. Invert Binary Tree--LeetCode Record
- error C2872: “flann”: 不明确的符号 --- PCL 与OpenCV2 的flann命名空间冲突问题的解决方法
- JQuert选择器
- java 日期处理工具类 DateUtil
- LeetCode 069 Sqrt(x)
- 38. Count and Say
- Xcode中使用opencv
- Java线程面试题 Top 50
- LoadRunner性能测试入门教程