dijkstra算法

用一个n行2列的数组res[n][2]来存结果便可,其中第一列存到源点start_p的距离,第二列存改点到源点最短路径的前一个节点。ios 每一次在加入节点都是加入的当前时刻距离源点距离最近的那个点。web #include <iostream> #include <stdio.h> using namespace std; #define INF 10000 int edge[1000][1
相关文章
相关标签/搜索