计算图的传递闭包Procedure Longli

19 查阅
计算图的传递闭包Procedure Longlink;VarT:array[1..maxn,1..maxn] of boolean;

参考答案:

正确答案:

\r\n

Begin
Fillchar(t,sizeof(t),false);
For k:=1 to n do
For I:=1 to n do
For j:=1 to n do T[I,j]:=t[I,j] or (t[I,k] and t[k,j]);
End;