
tree
MVincent
这个作者很懒,什么都没留下…
展开
-
leetcode 543 Diameter of Binary Tree
python: class Solution: def diameterOfBinaryTree(self, root): """ :type root: TreeNode :rtype: int """ if not root: return 0 self.long...原创 2018-07-17 21:26:05 · 182 阅读 · 0 评论 -
leetcode 872 Leaf-Similar Trees
python: class Solution: def leafSimilar(self, root1, root2): """ :type root1: TreeNode :type root2: TreeNode :rtype: bool """ def leaf(root): ...原创 2018-09-28 09:52:59 · 186 阅读 · 0 评论 -
leetcode 257 Binary Tree Paths
python: class Solution(object): def binaryTreePaths(self, root): """ :type root: TreeNode :rtype: List[str] """ path = '' res = [] self.Tr...原创 2018-10-08 10:08:15 · 208 阅读 · 0 评论 -
leetcode 637 Average of Levels in Binary Tree
python: class Solution: def averageOfLevels(self, root): """ :type root: TreeNode :rtype: List[float] """ if root is None: return [] r...原创 2018-10-24 11:10:35 · 269 阅读 · 0 评论