Skip to content

Commit 941feda

Browse files
diegopaiva1trekhleb
authored andcommitted
Fix kruskal's exception message for directed graph (trekhleb#138)
1 parent 88bbfdc commit 941feda

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/algorithms/graph/kruskal/kruskal.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default function kruskal(graph) {
1010
// It should fire error if graph is directed since the algorithm works only
1111
// for undirected graphs.
1212
if (graph.isDirected) {
13-
throw new Error('Prim\'s algorithms works only for undirected graphs');
13+
throw new Error('Kruskal\'s algorithms works only for undirected graphs');
1414
}
1515

1616
// Init new graph that will contain minimum spanning tree of original graph.

0 commit comments

Comments
 (0)