From 77381f8733608ffe3f759ed3e2b73ca05d940191 Mon Sep 17 00:00:00 2001 From: Aleksandr Mishukhin <100044766+aleksmish@users.noreply.github.com> Date: Mon, 30 Jun 2025 22:15:08 +0300 Subject: [PATCH] fix typo Changed "an selected" to "a selected" --- src/graph/mst_prim.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graph/mst_prim.md b/src/graph/mst_prim.md index 21649f28d..8815a2630 100644 --- a/src/graph/mst_prim.md +++ b/src/graph/mst_prim.md @@ -147,7 +147,7 @@ void prim() { ``` 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. -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). +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). 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. ### Sparse graphs: $O(m \log n)$
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: