File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
src/algorithms/pseudocode Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -4,12 +4,14 @@ import parse from '../../pseudocode/parse';
4
4
export default parse ( `
5
5
\\Code{
6
6
Main
7
- Prim(G, s) // Given a weighted graph G, return a minimum spanning tree \\B 1
8
- // for the graph component that includes s (with a different termination
9
- // condition a minimum spanning forest for all graph components could
10
- // be found). Nodes are numbered 1..nmax. Prim returns the Parent
11
- // array, which gives a path from each connected node back to
12
- // the root s (which has 0 as the parent).
7
+ Prim(G, s) // Find a minimum spanning tree for graph G starting at node s \\B 1
8
+ \\Expl{ Given a weighted graph G, return a minimum spanning tree
9
+ for the graph component that includes s (with a different termination
10
+ condition a minimum spanning forest for all graph components could
11
+ be found). Nodes are numbered 1..nmax. Prim returns the Parent
12
+ array, which gives a path from each connected node back to
13
+ the root s (which has 0 as the parent).
14
+ \\Expl}
13
15
\\In{
14
16
initialise, with fontier={s}, stored in Nodes \\Ref Init
15
17
while Nodes is not empty \\B 2
You can’t perform that action at this time.
0 commit comments