mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-12-19 07:00:35 +08:00
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:
committed by
GitHub
parent
51fcc66345
commit
87b17e0571
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user