If we found leaves in both trees
if ( temp1 != NULL && temp2 != NULL ) { if ( temp1 -> data != temp2 -> data ) { cout << " First ▁ non ▁ matching ▁ leaves ▁ : ▁ " << temp1 -> data << " ▁ " << temp2 -> data << endl ; return ; } } } }