mirror of
https://github.com/trekhleb/javascript-algorithms.git
synced 2026-03-13 08:51:02 +08:00
Fix kruskal's exception message for directed graph (#138)
This commit is contained in:
committed by
Oleksii Trekhleb
parent
88bbfdc470
commit
941feda305
@@ -10,7 +10,7 @@ export default function kruskal(graph) {
|
||||
// It should fire error if graph is directed since the algorithm works only
|
||||
// for undirected graphs.
|
||||
if (graph.isDirected) {
|
||||
throw new Error('Prim\'s algorithms works only for undirected graphs');
|
||||
throw new Error('Kruskal\'s algorithms works only for undirected graphs');
|
||||
}
|
||||
|
||||
// Init new graph that will contain minimum spanning tree of original graph.
|
||||
|
||||
Reference in New Issue
Block a user