摘要: 区别在于图的可达性。如果由任意节点出发(以任意节点为根)可以到达所有节点, 那么遍历就只需要跑一次dfs;若可达性无法保证,则需要多次运行dfs; #include<bits/stdc++.h> using namespace std; #define N 10001 int m,n; int vt 阅读全文
posted @ 2024-12-07 09:29 邓佑孤 阅读(28) 评论(0) 推荐(0)