美文网首页
2020-04-01 Day 39 Leetcode: 94.

2020-04-01 Day 39 Leetcode: 94.

作者: YueTan | 来源:发表于2020-04-01 08:59 被阅读0次
    class Solution:
        
        def inorderTraversal(self, root: TreeNode) -> List[int]:
            result=[]
            self.helper(root,result)
            return result
            
        def helper(self,root,result):
            if root is None:
                return
            self.helper(root.left,result)
            result.append(root.val)
            self.helper(root.right,result)
    

    相关文章

      网友评论

          本文标题:2020-04-01 Day 39 Leetcode: 94.

          本文链接:https://www.haomeiwen.com/subject/wkfouhtx.html