B站视频地址:LeetCode323_无向图中连通分量的数目_BFS
class Solution {
public int countComponents(int n, int[][] edges) {
List<Integer>[] adj = buildGraph(n, edges);
boolean[] visited = new boolean[n];
int result = 0;
for (int i = 0; i < n


1032

被折叠的 条评论
为什么被折叠?



