2020-04-01 Day 39 Leetcode: 94.

2020-04-01  本文已影响0人  YueTan
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)
上一篇下一篇

猜你喜欢

热点阅读