513. Find Bottom Left Tree Value
来源:互联网 发布:电魂网络新游戏 编辑:程序博客网 时间:2024/06/05 16:45
广度优先遍历
class Solution(object): def findBottomLeftValue(self, root): """ :type root: TreeNode :rtype: int """ queue = collections.deque() queue.append(root) while(queue): root = queue.popleft() if (root): if (root.right): queue.append(root.right) if (root.left): queue.append(root.left)
class Solution(object): def finBottomLeftValue(self,root): queue=[root] for node in queue: queue += filter(None,[node.right,node.left]) return node.val
0 0
- LeetCode 513. Find Bottom Left Tree Value
- [leetcode]513. Find Bottom Left Tree Value
- 513. Find Bottom Left Tree Value
- 513. Find Bottom Left Tree Value
- [leetcode] 513. Find Bottom Left Tree Value
- 513. Find Bottom Left Tree Value
- 513. Find Bottom Left Tree Value
- 513. Find Bottom Left Tree Value
- 【LeetCode】513. Find Bottom Left Tree Value
- 513. Find Bottom Left Tree Value
- Leetcode 513. Find Bottom Left Tree Value
- LeetCode 513. Find Bottom Left Tree Value
- [DFS]513. Find Bottom Left Tree Value
- LeetCode 513. Find Bottom Left Tree Value
- 513. Find Bottom Left Tree Value
- 【leetcode】 513. Find Bottom Left Tree Value
- 513. Find Bottom Left Tree Value | LeetCode
- 513. Find Bottom Left Tree Value
- MapReduce向Map函数传递参数: Configuration类
- 异常: java.lang.NoClassDefFoundError: org/apache/commons/collections/map/ListOrderedMap 解决方法
- 第二次上机作业
- js的arguments
- vs2012 编译jsoncpp和使用jsoncpp lib出现的问题
- 513. Find Bottom Left Tree Value
- Git 版本管理系统
- C# 输入法
- XML——c#读取带命名空间的xml
- c++实验,1000到10000之间个位和千位相等的质数
- 米斯特白帽培训讲义(v2)实战篇 余闻同学录
- js基础--this大揭秘
- hdu 5935 Car(贪心)
- 博弈之SG函数(详解为什么异或可以得出结果)