Skip to content

Commit b7d0e3e

Browse files
committed
Forgot Prim's
1 parent bde11c3 commit b7d0e3e

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/algorithms/pseudocode/prim.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ import parse from '../../pseudocode/parse';
44
export default parse(`
55
\\Code{
66
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}
1315
\\In{
1416
initialise, with fontier={s}, stored in Nodes \\Ref Init
1517
while Nodes is not empty \\B 2

0 commit comments

Comments
 (0)