单选题 若要求在找到从S到其他顶点最短路的同时,还给出不同的最短路的条数,我们可以将Dijkstra算法略作修改,增加一个count[]数组:count[V]记录S到顶点V的最短路径有多少条。则count[V]应该被初始化为:
相关试题
单选题 In a weighted graph, if the length of the shortest path from b to a is 10, and there exists an edge of weight 3 between c and
B, then how many of the following statements is/are TRUE?
The length of the shortest path from c to a must be 13.
The length of the shortest path from c to a must be 7.
The length of the shortest path from c to a must be no greater than 13.
The length of the shortest path from c to a must be no less than 7.
单选题 设图中顶点总数为n,求解任意两个顶点之间的最短路径的Floyd算法的时间复杂度为( )
判断题 Let P be the shortest path from S to T. If the weight of every edge in the graph is incremented by 1, P will still be the shortest path from S to T.
正确
错误
单选题 Dijkstra's Algorithm cannot be applied on ______________
单选题 Dijkstra算法 2.Prim算法 3.Floyd算法 4.Kruskal算法
单选题 Which of the following statements is FALSE about the shortest path algorithms?
单选题 Dijkstra算法是____方法求出图中从某顶点到其余顶点的最短路径的。
判断题 P 是顶点 S 到 T 的最短路径,如果该图中的所有路径的权值都加 1,P 仍然是 S 到 T 的最短路径。
正确
错误