mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-09 19:44:45 +08:00
Update 二叉树的递归遍历.md
This commit is contained in:
@ -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:
|
||||
|
Reference in New Issue
Block a user