Code:
Point& Point:perator =(const Point & rhs)
{
value = rhs.index;
return *this;
}
Your copy constructor assigns value to rhs.index.
Code:
Point & DisjSets::findPathcompression( Point & a )
{
if( a.value < 0 )
return a;
else
return s[a.index] = findPathcompression(s[a.value]);
}
I would make an Point* field parent then all that would
be necessary I think is
Code:
Point* DisjSets::findPathcompression( Point & a )
{
if( a.parent == NULL)
return &a;
else
return a.parent = findPathcompression(a.parent);
}