Skip to content

Commit 8545d78

Browse files
committed
Fix
1 parent 19c492d commit 8545d78

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/test/java/com/thealgorithms/datastructures/graphs/BipartiteGraphDFSTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import static org.junit.jupiter.api.Assertions.assertFalse;
44
import static org.junit.jupiter.api.Assertions.assertTrue;
55

6-
import org.junit.jupiter.api.Test;
76
import java.util.ArrayList;
7+
import org.junit.jupiter.api.Test;
88

99
public class BipartiteGraphDFSTest {
1010

@@ -26,23 +26,23 @@ private ArrayList<ArrayList<Integer>> createAdjacencyList(int numVertices, int[]
2626
@Test
2727
public void testBipartiteGraphEvenCycle() {
2828
int numVertices = 4;
29-
int[][] edges = { {0, 1}, {1, 2}, {2, 3}, {3, 0} }; // Even cycle
29+
int[][] edges = {{0, 1}, {1, 2}, {2, 3}, {3, 0}}; // Even cycle
3030
ArrayList<ArrayList<Integer>> adj = createAdjacencyList(numVertices, edges);
3131
assertTrue(BipartiteGraphDFS.isBipartite(numVertices, adj), "Graph should be bipartite (even cycle)");
3232
}
3333

3434
@Test
3535
public void testBipartiteGraphOddCycle() {
3636
int numVertices = 5;
37-
int[][] edges = { {0, 1}, {1, 2}, {2, 0}, {1, 3}, {3, 4} }; // Odd cycle
37+
int[][] edges = {{0, 1}, {1, 2}, {2, 0}, {1, 3}, {3, 4}}; // Odd cycle
3838
ArrayList<ArrayList<Integer>> adj = createAdjacencyList(numVertices, edges);
3939
assertFalse(BipartiteGraphDFS.isBipartite(numVertices, adj), "Graph should not be bipartite (odd cycle)");
4040
}
4141

4242
@Test
4343
public void testBipartiteGraphDisconnected() {
4444
int numVertices = 6;
45-
int[][] edges = { {0, 1}, {2, 3}, {4, 5} }; // Disconnected bipartite graphs
45+
int[][] edges = {{0, 1}, {2, 3}, {4, 5}}; // Disconnected bipartite graphs
4646
ArrayList<ArrayList<Integer>> adj = createAdjacencyList(numVertices, edges);
4747
assertTrue(BipartiteGraphDFS.isBipartite(numVertices, adj), "Graph should be bipartite (disconnected)");
4848
}
@@ -58,15 +58,15 @@ public void testBipartiteGraphSingleVertex() {
5858
@Test
5959
public void testBipartiteGraphCompleteBipartite() {
6060
int numVertices = 4;
61-
int[][] edges = { {0, 2}, {0, 3}, {1, 2}, {1, 3} }; // K2,2 (Complete bipartite graph)
61+
int[][] edges = {{0, 2}, {0, 3}, {1, 2}, {1, 3}}; // K2,2 (Complete bipartite graph)
6262
ArrayList<ArrayList<Integer>> adj = createAdjacencyList(numVertices, edges);
6363
assertTrue(BipartiteGraphDFS.isBipartite(numVertices, adj), "Graph should be bipartite (complete bipartite)");
6464
}
6565

6666
@Test
6767
public void testBipartiteGraphNonBipartite() {
6868
int numVertices = 3;
69-
int[][] edges = { {0, 1}, {1, 2}, {2, 0} }; // Triangle (odd cycle)
69+
int[][] edges = {{0, 1}, {1, 2}, {2, 0}}; // Triangle (odd cycle)
7070
ArrayList<ArrayList<Integer>> adj = createAdjacencyList(numVertices, edges);
7171
assertFalse(BipartiteGraphDFS.isBipartite(numVertices, adj), "Graph should not be bipartite (triangle)");
7272
}

0 commit comments

Comments
 (0)