Skip to content

Commit 77381f8

Browse files
authored
fix typo
Changed "an selected" to "a selected"
1 parent 0da3b79 commit 77381f8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/graph/mst_prim.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ void prim() {
147147
```
148148

149149
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 to an 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 to a selected vertex for each not-yet-selected vertex (it stores the weight and the end vertex).
151151
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.
152152

153153
### Sparse graphs: $O(m \log n)$

0 commit comments

Comments
 (0)