style: enable NeedBraces in checkstyle (#5227)

* enable style NeedBraces

* style: enable NeedBraces in checkstyle

---------

Co-authored-by: Samuel Facchinello <samuel.facchinello@piksel.com>
This commit is contained in:
Samuel Facchinello
2024-06-13 21:00:16 +02:00
committed by GitHub
parent 51fcc66345
commit 87b17e0571
68 changed files with 629 additions and 261 deletions

View File

@@ -127,7 +127,9 @@ public class Kosaraju {
private void dfs(int node, int[] vis, List<List<Integer>> list) {
vis[node] = 1;
for (Integer neighbour : list.get(node)) {
if (vis[neighbour] == 0) dfs(neighbour, vis, list);
if (vis[neighbour] == 0) {
dfs(neighbour, vis, list);
}
}
stack.push(node);
}
@@ -136,7 +138,9 @@ public class Kosaraju {
private void dfs2(int node, int[] vis, List<List<Integer>> list) {
vis[node] = 1;
for (Integer neighbour : list.get(node)) {
if (vis[neighbour] == 0) dfs2(neighbour, vis, list);
if (vis[neighbour] == 0) {
dfs2(neighbour, vis, list);
}
}
scc.add(node);
}

View File

@@ -82,7 +82,9 @@ public class TarjansAlgorithm {
Stack<Integer> st = new Stack<Integer>();
for (int i = 0; i < v; i++) {
if (insertionTime[i] == -1) stronglyConnCompsUtil(i, lowTime, insertionTime, isInStack, st, graph);
if (insertionTime[i] == -1) {
stronglyConnCompsUtil(i, lowTime, insertionTime, isInStack, st, graph);
}
}
return sccList;