Home / Engineering / Design and Analysis of Algorithms / Question

M

Mr. Dubey • 51.17K Points
Coach

Q.) The maximum number of times the decrease key operation performed in Dijkstra’s algorithm will be equal to

(A) total number of vertices
(B) total number of edges
(C) number of vertices – 1
(D) number of edges – 1
Correct answer : Option (B) - total number of edges

Explanation:
 if the total number of edges in all adjacency list is e, then there will be a total of e number of iterations, hence there will be a total of at most e decrease key operations.

Share

Discusssion

Login to discuss.