I have got all of them but transitive now... I do not know how to include c in my functions. Transitive means: If aRb and bRc, then aRc. Here is my reflexive function... How can I change them to make it test for transitive?
Code:
void reflexive(int a[], int sizeOfA, int b[], int sizeOfB){
int i, j;
bool test;
bool hold = true;
for(i = 0; i < sizeOfA; i++)
{
if(hold == true)
{
for(j = 0; j < sizeOfB;)
{
if(b[j]==a[i] && b[j+1]==a[i])
{
hold = true;
break;
}
else
{
hold = false;
j++;
}
}
}
}
if(hold == true)
{
test = true;
cout << "Reflextive - Yes" << endl;
}
else
{
test = false;
cout << "Reflextive - No" << endl;
}
}