摘要
对求无向赋权图最小生成树两种算法分别是PRIM算法和KRUSKAL算法。本文通过用堆改进了PRIM方法中选择最小边的方法。结合C语言的特点,实现了集合的划分和合并。对KRUSKAL方法进行了探讨,弥补了一些数据结构教科书上未给出C语言实现的KRUSKAL算法的不足。
The two algorithms for finding the minimal spanning tree of an undirected weighted graph are PRIM algorithm and KRUSKAL algorithm. This paper improves the method for selecting the minimal edge in PRIM algorithm by using a heap. Combining the characteristics of programming langrage C, it implements set partition and merger and explores the realization of KRUSCAL algorithm. This overcomes the shortage of not giving the KRUSCAL algorithm in langrage C in some data structure textbooks.
出处
《华东船舶工业学院学报》
2004年第2期27-32,共6页
Journal of East China Shipbuilding Institute(Natural Science Edition)