Algorithms | Graph Shortest Paths | Question 7
What is the time complexity of Bellman-Ford single-source shortest path algorithm on a complete graph of n vertices?
(A)
(B)
(C)
(D)
Answer: (C)
Explanation: Time complexity of Bellman-Ford algorithm is where V is number of vertices and E is number edges (See this). If the graph is complete, the value of E becomes
. So overall time complexity becomes
Quiz of this Question
Please Login to comment...