题目如下:
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)
时间: 2024-10-12 12:13:00
题目如下:
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)