Update 二叉树的递归遍历.md
This commit is contained in:
parent
dd58553088
commit
dd1da7fc54
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in New Issue