Question:medium

The Bellman-Ford algorithm is preferred over Dijkstra's algorithm when the graph contains:

Show Hint

While Bellman-Ford is more versatile, it is significantly slower than Dijkstra. Bellman-Ford has a time complexity of $O(VE)$, whereas Dijkstra with a Fibonacci heap is $O(E + V \log V)$.
Updated On: Jul 4, 2026
  • Positive weight cycles
  • Large number of nodes
  • Negative weight edges
  • Disconnected components
Show Solution

The Correct Option is C

Solution and Explanation

Was this answer helpful?
0