We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 404953b commit 6ca34beCopy full SHA for 6ca34be
thinkings/binary-tree-traversal.md
@@ -103,7 +103,7 @@ BFS 的关键点在于如何记录每一层次是否遍历完成, 我们可以
103
104
## 双色标记法
105
106
-我们直到垃圾回收算法中,有一种算法叫三色标记法。 即:
+我们知道垃圾回收算法中,有一种算法叫三色标记法。 即:
107
108
- 用白色表示尚未访问
109
- 灰色表示尚未完全访问子节点
@@ -137,7 +137,7 @@ class Solution:
137
return res
138
```
139
140
-如要实现前序、后序遍历,只需要调整左右子节点的入栈顺序即可。
+如要实现前序、后序遍历,只需要调整左右子节点的入栈顺序即可。可以看出使用三色标记法, 其写法类似递归的形式,因此便于记忆和书写,缺点是使用了额外的内存空间。不过这个额外的空间是线性的,影响倒是不大。
141
142
## Morris 遍历
143
0 commit comments