Update 二叉树的递归遍历.md

This commit is contained in:
jianghongcheng
2023-05-03 19:27:58 -05:00
committed by GitHub
parent dd58553088
commit dd1da7fc54

View File

@ -191,7 +191,8 @@ class Solution:
return [root.val] + left + right
```
```python
# 中序遍历-递归-LC94_二叉树的中序遍历
class Solution:
def inorderTraversal(self, root: TreeNode) -> List[int]:
@ -202,6 +203,9 @@ class Solution:
right = self.inorderTraversal(root.right)
return left + [root.val] + right
```
```python
# 后序遍历-递归-LC145_二叉树的后序遍历
class Solution: