diff --git a/problems/二叉树的迭代遍历.md b/problems/二叉树的迭代遍历.md index 35cf4077..8b241465 100644 --- a/problems/二叉树的迭代遍历.md +++ b/problems/二叉树的迭代遍历.md @@ -258,7 +258,9 @@ class Solution: if node.left: stack.append(node.left) return result - +``` +```python + # 中序遍历-迭代-LC94_二叉树的中序遍历 class Solution: def inorderTraversal(self, root: TreeNode) -> List[int]: @@ -279,7 +281,9 @@ class Solution: # 取栈顶元素右结点 cur = cur.right return result - + ``` + ```python + # 后序遍历-迭代-LC145_二叉树的后序遍历 class Solution: def postorderTraversal(self, root: TreeNode) -> List[int]: