Driver method to test above method
int main ( ) { int set1 [ ] = { 10 , 5 , 3 , 4 , 6 } ; int set2 [ ] = { 8 , 7 , 9 , 3 } ; int n1 = sizeof ( set1 ) / sizeof ( set1 [ 0 ] ) ; int n2 = sizeof ( set2 ) / sizeof ( set2 [ 0 ] ) ; if ( areDisjoint ( set1 , set2 , n1 , n2 ) ) cout << " Yes " ; else cout << " No " ; }