无向图的连通分量A.深度优先procedure
19 查阅
参考答案:
begin
\r\n
for i:=1 to n do
if a[now,i] and c[i]=0 then begin {对结点I染色}
c[i]:=color;
dfs(I,color);
end;
end;
参考答案:
begin
\r\n
for i:=1 to n do
if a[now,i] and c[i]=0 then begin {对结点I染色}
c[i]:=color;
dfs(I,color);
end;
end;