What is the pseudo code to compute the shortest path in Dijkstra's algorithm?
A.
if(T[w].Known)
if(T[v].Dist + C(v,w) < T[w].Dist) {
Increase (T[w].Dist to T[v].Dist +C(v,w));
T[w].path=v; }B.
if(!T[w].Known)
if(T[v].Dist + C(v,w) > T[w].Dist) {
Decrease(T[w].Dist to T[v].Dist +C(v,w);
T[w].path=v; }C.
if(!T[w].Known)
if(T[v].Dist + C(v,w) < T[w].Dist) {
Decrease(T[w].Dist to T[v].Dist +C(v,w));
T[w].path=v; }D.
if(T[w].Known)
if(T[v].Dist + C(v,w) < T[w].Dist) {
Increase(T[w].Dist to T[v].Dist);
T[w].path=v; }Answer: Option C
Related Questions on Graph Algorithms (DFS, BFS, Dijkstras, etc)
A. Breadth-First Search (BFS)
B. Depth-First Search (DFS)
C. Bellman-Ford Algorithm
D. Dijkstra's Algorithm
What is the time complexity of Breadth-First Search (BFS) on a graph with V vertices and E edges?
A. O(V + E)
B. O(V2)
C. O(E log V)
D. O(V log V)
In Depth-First Search (DFS), what is the order of visiting nodes?
A. Level order
B. Inorder
C. Postorder
D. Preorder
Which algorithm can be used to detect negative weight cycles in a graph?
A. Dijkstra's Algorithm
B. Prim's Algorithm
C. Bellman-Ford Algorithm
D. Kruskal's Algorithm

Join The Discussion