Skip to content

Commit b2757b5

Browse files
itakurahvil02
andauthored
Update src/main/java/com/thealgorithms/datastructures/graphs/BoruvkaAlgorithm.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
1 parent c47c59a commit b2757b5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,11 @@ private static class Component {
7676
* Represents the state of Union-Find components and the result list
7777
*/
7878
private static class BoruvkaState {
79-
List<Edge> result;
79+
List<Edge> result = new ArrayList<>();;
8080
Component[] components;
81-
Graph graph;
81+
final Graph graph;
8282

83-
BoruvkaState(Graph graph) {
84-
this.result = new ArrayList<>();
83+
BoruvkaState(final Graph graph) {
8584
this.components = initializeSubsets(graph);
8685
this.graph = graph;
8786
}

0 commit comments

Comments
 (0)