Skip to content

Commit dd01551

Browse files
committed
Updated PrismAlgorithm-II
1 parent 2a4cff0 commit dd01551

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/com/thealgorithms/graph/PrimAlgorithm.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ private PrimAlgorithm() {
1919
* @param node the target node connected by the edge
2020
* @param weight the weight of the edge
2121
*/
22-
private record Pair(int node, int weight) {}
22+
private record Pair(int node, int weight) {
23+
}
2324

2425
/**
2526
* Computes the total weight of the Minimum Spanning Tree (MST)
@@ -71,7 +72,6 @@ public static int spanningTree(int V, ArrayList<ArrayList<ArrayList<Integer>>> a
7172
int adjNode = edge.get(0);
7273
int edgeWeight = edge.get(1);
7374

74-
// Only consider unvisited nodes
7575
if (!visited[adjNode]) {
7676
pq.add(new Pair(adjNode, edgeWeight));
7777
}

0 commit comments

Comments
 (0)