Here is my code to implement dijkstra's algorithm in shortest path to show vertices and that are known with shortest path. This is stressing me out. The output is 5 0 1 2 3 4 6. From it any help will be happy Code: void d_run(Table T, Graph G){ Vertex V, W; V = 0; W = 0; for (int i = 0; i < T.V; i++){ int newdist = 0; int current = 20000; for (int j = 0; j < T.V; j++) { newdist = T.entries[j].dist; if (newdist < current && (T.entries[j].known == false)){ current = newdist; V = j; } } if (V == notavertex){ break; } T.entries[V].known = true; // pointer to beginning of list of edges need // to work out how to read them T.entries[V].header = G.edges[i]; //T.entries[V].header = T.entries[W].header; //for (){ if (!T.entries[W].known){ if (T.entries[V].dist < T.entries[W].dist){ T.entries[W].dist = T.entries[V].dist; T.entries[W].path = V; } //return T.entries; } printf("%d ", V); //} } printf("\n"); }