摘要: 附代码View Code 1 /* 2 无向图的联通分量 3 dfs 4 */ 5 #include<stdio.h> 6 #include<string.h> 7 const int maxn =30 ; 8 int map[ maxn ][ maxn ]; 9 int vis[ maxn ];10 int max;11 void dfs( int now ){12 //vis[ now ]=1;13 for( int i=1;i<=max;i++ ){14 if( map[ now ][ i ]==0||map[ i ][ now ]==0 ) conti.. 阅读全文
posted @ 2012-12-17 00:18 xxx0624 阅读(184) 评论(0) 推荐(0) 编辑