每日一题力扣94 二叉树的中序遍历

给定一个二叉树的根节点 root ,返回它的 中序 遍历。

示例 1:

输入:root = [1,null,2,3]
输出:[1,3,2]
class Solution:
    def inorderTraversal(self, root: TreeNode) -> List[int]:
        def in_order(t):
            if not t:
                return 
            in_order(t.left)
            res.append(t.val)
            in_order(t.right)
        res=[]
        in_order(root)
        return res
原文地址:https://www.cnblogs.com/liuxiangyan/p/14658908.html