javascript-datastructures-algorithms icon indicating copy to clipboard operation
javascript-datastructures-algorithms copied to clipboard

Incorrect return value of Kruskal

Open tequ1lAneio opened this issue 2 years ago • 0 comments

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!

tequ1lAneio avatar Jul 31 '22 16:07 tequ1lAneio