C++问题,有一段内容看不懂he ’safe edge’ theory GENERIC-MST-FUNCTION (G,w) 1 T := Φ 2 while T is not yet a ‘tree’ 3 do look for a ‘safe edge’ (u,v) for T 4 T := T U {(u,v)} 5 return T A ‘safe edge’ is generated each time.谁
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/17 07:37:56
C++问题,有一段内容看不懂he ’safe edge’ theory GENERIC-MST-FUNCTION (G,w) 1 T := Φ 2 while T is not yet a ‘tree’ 3 do look for a ‘safe edge’ (u,v) for T 4 T := T U {(u,v)} 5 return T A ‘safe edge’ is generated each time.谁
C++问题,有一段内容看不懂
he ’safe edge’ theory
GENERIC-MST-FUNCTION (G,w)
1 T := Φ
2 while T is not yet a ‘tree’
3 do look for a ‘safe edge’ (u,v) for T
4 T := T U {(u,v)}
5 return T
A ‘safe edge’ is generated each time.
谁能解释一下这段内容.
C++问题,有一段内容看不懂he ’safe edge’ theory GENERIC-MST-FUNCTION (G,w) 1 T := Φ 2 while T is not yet a ‘tree’ 3 do look for a ‘safe edge’ (u,v) for T 4 T := T U {(u,v)} 5 return T A ‘safe edge’ is generated each time.谁
这个不是C++代码.是伪代码吧.
你这个是外国翻译过来的书吧,外国的书就是这样子.
你还是看中国人写的书吧,写的简单易懂.
大致的意思翻译一下.
这个是最小生成树的一段?
GENERIC-MST-FUNCTION (G,w)
T := 空集合
while T 还不是生成树
do 找出对 T 来说是不会形成cycle,且权重最低的边 (u,v)
T := T U {(u,v)}//(u,v)加入生成树
return T