You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Union-find is data structure that handles unification of equivalence classes, not intervals.
In your case [[1,2], [2,3], [4,5]] translates to 1=2, 2=3, 4=5 which means that you have two classes of equivalence {1, 2, 3}, {4, 5} and hence the algorithm outputs their components accordingly.
Hey @coells,
Could you provide some details about the union find code please?
For instance if I give the following intervals as input :
why do I get as output :
Should I just ignore items 0, 6 -> 9 ? and notice that items 1, 2, 3 are as expected in the same group, and 4, 5 in another group?
regards
The text was updated successfully, but these errors were encountered: