Skip to content

Commit 0ed5552

Browse files
author
Divyansh Saxena
committed
Format array initializers for Clang Format
1 parent 97396c2 commit 0ed5552

File tree

2 files changed

+5
-23
lines changed

2 files changed

+5
-23
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +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 = {
79-
{ 0, 1, 1 },
80-
{ 1, 0, 1 },
81-
{ 1, 1, 0 }
82-
};
78+
int[][] matrix = { { 0, 1, 1 }, { 1, 0, 1 }, { 1, 1, 0 } };
8379

8480
Cycle c = new Cycle(nodes, matrix);
8581
c.start();

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

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@ class CyclesTest {
1414
void testTriangleCycle() {
1515
// Triangle graph: 0-1, 1-2, 2-0
1616
int nodes = 3;
17-
int[][] matrix = {
18-
{ 0, 1, 1 },
19-
{ 1, 0, 1 },
20-
{ 1, 1, 0 }
21-
};
17+
int[][] matrix = { { 0, 1, 1 }, { 1, 0, 1 }, { 1, 1, 0 } };
2218

2319
Cycle c = new Cycle(nodes, matrix);
2420
c.start();
@@ -45,11 +41,7 @@ void testTriangleCycle() {
4541
void testNoCycle() {
4642
// Line graph: 0 -> 1 -> 2
4743
int nodes = 3;
48-
int[][] matrix = {
49-
{ 0, 1, 0 },
50-
{ 0, 0, 1 },
51-
{ 0, 0, 0 }
52-
};
44+
int[][] matrix = { { 0, 1, 0 }, { 0, 0, 1 }, { 0, 0, 0 } };
5345

5446
Cycle c = new Cycle(nodes, matrix);
5547
c.start();
@@ -62,9 +54,7 @@ void testNoCycle() {
6254
void testSelfLoop() {
6355
// Node 0 has self loop
6456
int nodes = 1;
65-
int[][] matrix = {
66-
{ 1 }
67-
};
57+
int[][] matrix = { { 1 } };
6858

6959
Cycle c = new Cycle(nodes, matrix);
7060
c.start();
@@ -79,11 +69,7 @@ void testSelfLoop() {
7969
@Test
8070
void testPrintAll() {
8171
int nodes = 3;
82-
int[][] matrix = {
83-
{ 0, 1, 1 },
84-
{ 1, 0, 1 },
85-
{ 1, 1, 0 }
86-
};
72+
int[][] matrix = { { 0, 1, 1 }, { 1, 0, 1 }, { 1, 1, 0 } };
8773
Cycle c = new Cycle(nodes, matrix);
8874
c.start();
8975
c.printAll(); // Ensure no exception

0 commit comments

Comments
 (0)