Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 C++ 中执行 DFS 算法以找到生成树,使用算法 DFS 生成树的输出始终是预排序的,还是纯属巧合?
如果您在输入它们时打印它们,则 DFS 根据定义是预购的。
预排序是按照深度优先搜索算法首次访问的顺序排列的顶点列表。
https://en.wikipedia.org/wiki/Depth-first_search