Skip to content

Commit 4f16f4f

Browse files
committed
修复和优化语句表述
1 parent 8e453f6 commit 4f16f4f

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

docs/05_tree/05_02_binary_tree_traverse.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -429,20 +429,6 @@ class Solution:
429429
- 不适用于递归实现
430430
- 空间复杂度可能较高(对于宽树)
431431

432-
### 6.3 适用场景
433-
434-
- **前序遍历**:树的复制、序列化、前缀表达式计算
435-
- **中序遍历**:二叉搜索树的有序遍历、中缀表达式计算
436-
- **后序遍历**:树的删除、后缀表达式计算、计算树的高度
437-
- **层序遍历**:按层打印树、计算树的宽度、BFS相关算法
438-
439-
### 6.4 实现建议
440-
441-
1. **递归实现**:代码简洁,易于理解,适合面试和教学
442-
2. **非递归实现**:性能更好,避免栈溢出,适合生产环境
443-
3. **选择原则**:根据具体需求选择合适的遍历方式,考虑时间复杂度和空间复杂度
444-
4. **优化技巧**:使用双端队列提高层序遍历效率,合理使用栈和队列数据结构
445-
446432
## 练习题目
447433

448434
- [0144. 二叉树的前序遍历](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0100-0199/binary-tree-preorder-traversal.md)

0 commit comments

Comments
 (0)