Graph DFS
dfs添加顶点到集合
在调用dfs的过程中,有四种添加顶点到集合的顺序:
- Pre-Order,在递归调用dfs之前将当前顶点添加到queue中
- Reverse Pre-Order,在递归调用dfs之前将当前顶点添加到stack中
- Post-Order,在递归调用dfs之后将当前顶点添加到queue中
- Reverse Post-Order,在递归调用dfs之后将当前顶点添加到stack中
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Comment
GitalkLivere