Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
gagolews committed Nov 18, 2024
1 parent 03aa7c6 commit 313bb6f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/c_gini_disjoint_sets.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ class CCountDisjointSets : public CDisjointSets{
if (x == y) throw std::invalid_argument("find(x) == find(y)");
if (y < x) std::swap(x, y);


// NOTE: we could have implemented union-by-size here,
// as we have the cluster size info;
// but then we wouldn't have that the new parent=minimum ID of members;
// which we need elsewhere.


// DisjointSet's merge part:
this->par[y] = x; // update the parent of y
this->k -= 1; // decrease the subset count
Expand Down

0 comments on commit 313bb6f

Please sign in to comment.