题解 | #二叉树的中序遍历#
二叉树的中序遍历
http://www.nowcoder.com/practice/0bf071c135e64ee2a027783b80bf781d
sys.setrecursionlimit(3000)
class Solution:
def inorderTraversal(self , root: TreeNode) -> List[int]:
# write code here
result=[]
def in_order(root):
if root:
in_order(root.left)
result.append(root.val)
in_order(root.right)
in_order(root)
return result