javascript-datastructures-algorithms
javascript-datastructures-algorithms copied to clipboard
Incorrect return value of Kruskal
Hi, @loiane
I found an unexpected result of Kruskal for getting MST. see https://github.com/loiane/javascript-datastructures-algorithms/blob/main/examples/chapter12/07-Kruskal.js#L18
When running the code above, the return value is [2, 2, 4, 2, 2]
instead of the expected result [2, 2, 2, 2, 2]
.
Could you take a look at it? Thanks!