数据结构与算法 DFS-BFS遍历&MST

DFS(深度优先) 时间复杂性:采用邻接矩阵存储结构时,查找所有顶点的邻接点所需时间为O(|V|2);
而采用邻接表时,找邻接点所需时间为O(|E|)。因此,DFS的时间复杂度为O(|V|+|E|) 。
BFS和DFS一样;
以邻接矩阵为存储结构的Prim算法中,时间复杂度为O(|V|2);
邻接表作为存储结构,Prim时间复杂度改进为O(|E|log|V|)。
Kruskal算法总体时间复杂度为O( |E|·log|V| )
1-1
Prim’s algorithm is to maintain a forest and to merge two trees into one at each stage. F
1-2
Kruskal’s algorithm is to maintain a forest and to merge two trees into one at each stage. T
1-3
Kruskal’s algorithm is to grow the minimum spanning tree by adding one edge, and thus an associated vertex, to the tree in each stage. F
Kruskal(应为Prim) 的算法是通过在每个阶段向树添加一条边并因此添加一个关联的顶点来生长最小生成树。
1-4
The minimum spanning tree of a connected weighted graph with vertex set V={ A, B, C, D, E } and weight set W={ 1, 3, 2, 5, 2, 7, 9, 8, 4 } must be unique. F
1-5
If graph G is a connected gra

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值