主要是DFS用于在图中找到循环而不是BFS.有什么原因?两者都可以在遍历树/图时查找是否已访问过节点.
algorithm tree graph breadth-first-search depth-first-search
algorithm ×1
breadth-first-search ×1
depth-first-search ×1
graph ×1
tree ×1