LeetCode(94)Binary Tree Inorder Traversal

题目如下:

Python代码:

    def inorderTraversal(self, root):
        res = []
        self.helper(root, res)
        return res
    
    def helper(self, root, res):
        if root:
            self.helper(root.left, res)
            res.append(root.val)
            self.helper(root.right, res)

 

posted @ 2017-07-12 13:48  Single、Dog  阅读(142)  评论(0编辑  收藏  举报