Skip to content

Commit 1ae4ab9

Browse files
refactor 323
1 parent 00f7656 commit 1ae4ab9

File tree

1 file changed

+0
-24
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-24
lines changed

src/main/java/com/fishercoder/solutions/_323.java

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,6 @@
55
import java.util.List;
66
import java.util.Queue;
77

8-
/**
9-
* 323. Number of Connected Components in an Undirected Graph
10-
*
11-
* Given n nodes labeled from 0 to n - 1 and a list of undirected edges (each edge is a pair of nodes), write a function to find the number of connected components in an undirected graph.
12-
13-
Example 1:
14-
15-
0 3
16-
| |
17-
1 --- 2 4
18-
19-
Given n = 5 and edges = [[0, 1], [1, 2], [3, 4]], return 2.
20-
21-
Example 2:
22-
23-
0 4
24-
| |
25-
1 --- 2 --- 3
26-
27-
Given n = 5 and edges = [[0, 1], [1, 2], [2, 3], [3, 4]], return 1.
28-
29-
Note:
30-
You can assume that no duplicate edges will appear in edges. Since all edges are undirected, [0, 1] is the same as [1, 0] and thus will not appear together in edges.
31-
*/
328
public class _323 {
339
public static class Solution1 {
3410

0 commit comments

Comments
 (0)