Vidyalelo
Data Structure · Q27

Graph Algorithms (DFS, BFS, Dijkstras, etc)

Programming · Data Structure · question 27

Q27

What is the purpose of the 'distance' array in Dijkstra's algorithm?

A.
To store the order of node visits.
B.
To track the number of edges.
C.
To store the parent nodes for each node.
D.
To store the shortest distance from the source to each node.
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board