登录
首页 » 数据结构 » Prim algorithm using minimum spanning tree of the experimental procedures used i...

Prim algorithm using minimum spanning tree of the experimental procedures used i...

于 2022-03-16 发布 文件大小:92.73 kB
0 76
下载积分: 2 下载次数: 1

代码说明:

用prim算法实验最小生成树 本程序中用到函数adjg( ),此函数作用是通过接受输入的点数和边数,建立无向图。函数prg( )用于计算并输出无向图的邻接矩阵。函数prim( )则用PRIM算法来寻找无向图的最小生成树 定义了两个数组lowcost[max],closest[max],若顶点k加入U中,则令lowcost[k]=0。 定义二维数组g[ ][ ]来建立无向图的邻接矩阵。 -Prim algorithm using minimum spanning tree of the experimental procedures used in function adjg (), this function is through the acceptance of input points and edges, the establishment of a directed graph. Function of prg () used to calculate and output undirected graph of adjacency matrix. Function prim () is used PRIM Algorithm to find the undirected graph of the minimum spanning tree array defines two lowcost [max], closest [max], if it joined the U of k vertices, then the lowcost [k] = 0. The definition of two-dimensional array g [] [] to create a undirected graph of adjacency matrix.

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 696518资源总数
  • 104230会员总数
  • 58今日下载