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.
AnswerAnswer: Option D
Solution
Answer: Option D
No explanation is given for this question Let's Discuss on Board