apply dfs and add nodes belonging to this component
for ( auto it : adj [ u ] ) { if ( ! vis [ it ] ) { componentSize += dfs ( it , adj , vis ) ; } } return componentSize ; } int maximumComponentSize ( int a [ ] , int n ) {