Skip to content

Commit 801460e

Browse files
author
Divyansh Saxena
committed
Apply clang-format using .clang-format config
1 parent 0ed5552 commit 801460e

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/main/java/com/thealgorithms/datastructures/graphs/Cycles.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ private Cycles() {
7575
public static void main(String[] args) {
7676
// Example usage with a triangle graph: 0 -> 1 -> 2 -> 0
7777
int nodes = 3;
78-
int[][] matrix = { { 0, 1, 1 }, { 1, 0, 1 }, { 1, 1, 0 } };
78+
int[][] matrix = {{0, 1, 1}, {1, 0, 1}, {1, 1, 0}};
7979

8080
Cycle c = new Cycle(nodes, matrix);
8181
c.start();

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import static org.junit.jupiter.api.Assertions.assertTrue;
66

77
import java.util.List;
8-
98
import org.junit.jupiter.api.Test;
109

1110
class CyclesTest {
@@ -14,7 +13,7 @@ class CyclesTest {
1413
void testTriangleCycle() {
1514
// Triangle graph: 0-1, 1-2, 2-0
1615
int nodes = 3;
17-
int[][] matrix = { { 0, 1, 1 }, { 1, 0, 1 }, { 1, 1, 0 } };
16+
int[][] matrix = {{0, 1, 1}, {1, 0, 1}, {1, 1, 0}};
1817

1918
Cycle c = new Cycle(nodes, matrix);
2019
c.start();
@@ -41,7 +40,7 @@ void testTriangleCycle() {
4140
void testNoCycle() {
4241
// Line graph: 0 -> 1 -> 2
4342
int nodes = 3;
44-
int[][] matrix = { { 0, 1, 0 }, { 0, 0, 1 }, { 0, 0, 0 } };
43+
int[][] matrix = {{0, 1, 0}, {0, 0, 1}, {0, 0, 0}};
4544

4645
Cycle c = new Cycle(nodes, matrix);
4746
c.start();
@@ -54,7 +53,7 @@ void testNoCycle() {
5453
void testSelfLoop() {
5554
// Node 0 has self loop
5655
int nodes = 1;
57-
int[][] matrix = { { 1 } };
56+
int[][] matrix = {{1}};
5857

5958
Cycle c = new Cycle(nodes, matrix);
6059
c.start();
@@ -69,7 +68,7 @@ void testSelfLoop() {
6968
@Test
7069
void testPrintAll() {
7170
int nodes = 3;
72-
int[][] matrix = { { 0, 1, 1 }, { 1, 0, 1 }, { 1, 1, 0 } };
71+
int[][] matrix = {{0, 1, 1}, {1, 0, 1}, {1, 1, 0}};
7372
Cycle c = new Cycle(nodes, matrix);
7473
c.start();
7574
c.printAll(); // Ensure no exception

0 commit comments

Comments
 (0)