πŸ“’ Too many exams? Don’t know which one suits you best? Book Your Free Expert πŸ‘‰ call Now!

  • google app store apple app store
  • βœ–

      Question

      Which algorithm guarantees the shortest path in a graph

      with negative weights but no negative cycles?
      A Dijkstra Correct Answer Incorrect Answer
      B Bellman-Ford Correct Answer Incorrect Answer
      C Floyd-Warshall Correct Answer Incorrect Answer
      D Prim Correct Answer Incorrect Answer
      E Kruskal Correct Answer Incorrect Answer

      Solution

      Bellman-Ford handles negative edge weights and detects negative cycles while finding shortest paths.

      Practice Next
      ask-question