scozv / algo-js

[obsoleted] has been moved to project Tango:
https://github.com/scozv/tango
GNU General Public License v3.0
2 stars 1 forks source link

potential out of range in WeightedQuickUnion #19

Closed scozv closed 10 years ago

scozv commented 10 years ago

From Algo.js of Google Code on September 28, 2013 17:47:29

What steps will reproduce the problem?

  1. we create a union(n) which has an id array with index from 0 to n-1 (inclusive)
  2. we use it in our Kruskal MST algorithm, where the index of vertex we pass into the union is from 1 ton (inclusive)

What is the expected output? What do you see instead? How it still works, without any out of index range error?

Please use labels and text to provide additional information. run following codes may get some answers:

var find = new union(10);
find.union(3, 10);
find._id.length;
find._id[10];

Original issue: http://code.google.com/p/algo-js/issues/detail?id=19

scozv commented 10 years ago

From Algo.js of Google Code on September 28, 2013 17:50:25

fixed in revision ddc054428915

Status: Fixed