Description
判断一个图是否为一个边通图
Input
n 顶点 (n<=100)
边
Output
1 表示连通
0 表示不边通
Sample Input
5
1 2
2 3
5 4
0 0
Sample Output
0
题解:
bfs和dfs,我想也不用解释了吧、、、
代码
bfs:
“`
var
a:array[0..100] of boolean;
b:array[0..100,0..100] of boolean;
min,n,y:longint;
procedure bfs(x:longint);
var
i,h,t:longint;
begin
h:=0;t:=1;
while h