【发布时间】:2014-04-03 12:33:12
【问题描述】:
我设计了一个算法,并试图找到能够得出 theta 的上限和下限:
ms(G,w)
for each v in G
make-set(v)
sort the edges of G.E into non-decreasing order by weight
if(find-set(v) not equal to find-set(u))
union(u,v)
else
feed=feed U {edge(u,v)}
如您所见,它与 kruskal 算法非常相似。这里我的问题是我无法理解 find-set 的运行时间
对于我拥有的另一部分:
makeset O(v) 排序 O(ElogE) 联合 O(1) 但是对于 find set 我不知道如何计算它?(你能告诉我计算的 union 运行时间是否为真)
【问题讨论】: