问题描述:
python:
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution(object):def inorder(self, root):if not root:returnself.inorder(root.left) # leftself.res.append(root.val) # rootself.inorder(root.right) # rightdef inorderTraversal(self, root):""":type root: TreeNode:rtype: List[int]"""self.res = list()self.inorder(root)return self.res