力扣 94. 二叉树的中序遍历

中序遍历

1
2
3
4
5
6
7
8
9
10
def inorderTraversal(root):
def order(node):
if not node:
return
order(node.left)
res.append(node.val)
order(node.right)
res = []
order(root)
return res
  • Copyright: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
  • Copyrights © 2022 eightyninth
  • Visitors: | Views:

请我喝杯咖啡吧~

支付宝
微信