<qiyuangong>547_Friend_Circles_1.java
public void dfs(int[][] M, int[] visited, int i) {
        for (int j = 0; j < M.length; j++) {
            if (M[i][j] == 1 && visited[j] == 0) {
                visited[j] = 1;
                dfs(M, visited, j);
            }
        }
    }
public void sample_funcname ( int [ ] [ ] M , int [ ] visited , int i ) {
  for ( int j = 0 ;
  j < M . length ;
  j ++ ) {
    if ( M [ i ] [ j ] == 1 && visited [ j ] == 0 ) {
      visited [ j ] = 1 ;
      dfs ( M , visited , j ) ;
    }
  }
}
