You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/graph/mst_prim.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -147,7 +147,7 @@ void prim() {
147
147
```
148
148
149
149
The adjacency matrix`adj[][]` of size $n \times n$ stores the weights of the edges, and it uses the weight`INF` if there doesn't exist an edge between two vertices.
150
-
The algorithm uses two arrays: the flag`selected[]`, which indicates which vertices we already have selected, and the array`min_e[]` which stores the edge with minimal weight toan selected vertex for each not-yet-selected vertex (it stores the weight and the end vertex).
150
+
The algorithm uses two arrays: the flag`selected[]`, which indicates which vertices we already have selected, and the array`min_e[]` which stores the edge with minimal weight toa selected vertex for each not-yet-selected vertex (it stores the weight and the end vertex).
151
151
The algorithm does $n$ steps, in each iteration the vertex with the smallest edge weight is selected, and the`min_e[]` of all other vertices gets updated.