I need to find the difference of 2 sets. below are my functions for the union and intersection of sets in my driver-file. Is the difference set a combination of the two?
IntegerSet IntegerSet::unionOfSets(IntegerSet b)
{
IntegerSet c;
for ( int i = 0; i < 101; i++ )
{
if ( set[i] || b.set[i] )
c.set[i] = 1;
}
return( c );
}
IntegerSet IntegerSet::intersectionOfSets(IntegerSet b)
{
IntegerSet d;
for ( int i = 0; i < 101; i++ )
{
if ( set[i] && b.set[i] )
d.set[i] = 1;
}
return( d );
}