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

… [Trackback]
[…] Here you will find 17768 more Info on that Topic: geeksforgeeks.org/algorithms-graph-shortest-paths-question-7/ […]
… [Trackback]
[…] Read More to that Topic: geeksforgeeks.org/algorithms-graph-shortest-paths-question-7/ […]