下列Dijkstra算法中,横线处应该填入的是( )。
#include <iostream> using namespace std; #define N 100 int n, e, s; const int inf = 0x7fffff; int dis[N + 1]; int cheak[N + 1]; int graph[N + 1][N + 1]; int main() { for (int i = 1; i <= N; i++) dis[i] = inf; cin >> n >> e; for (int i = 1; i <= e; i++) { int a, b, c; cin >> a >> b >> c; graph[a][b] = c; } cin >> s; dis[s] = 0; for (int i = 1; i <= n; i++) { int minn = inf, minx; for (int j = 1; j <= n; j++) { if (__________) { // 在此处填入选项 minn = dis[j]; minx = j; } } cheak[minx] = 1; for (int j = 1; j <= n; j++) { if (graph[minx][j] > 0) { if (minn + graph[minx][j] < dis[j]) { dis[j] = minn + graph[minx][j]; } } } } }
dis[j] > minn && cheak[j] == 0
dis[j] < minn && cheak[j] == 0
dis[j] >= minn && cheak[j] == 0
dis[j] < minn && cheak[j] != 0