What is the time complexity of Bellman-Ford single-source shortest path algorithm on a complete graph of n vertices?
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