📢 Too many exams? Don’t know which one suits you best? Book Your Free Expert 👉 call Now!


    Question

    Which algorithm is used to find the shortest path from a

    single source in graphs with negative weights?
    A Dijkstra Correct Answer Incorrect Answer
    B Bellman-Ford Correct Answer Incorrect Answer
    C Floyd-Warshall Correct Answer Incorrect Answer
    D Kruskal Correct Answer Incorrect Answer
    E Kruskal Correct Answer Incorrect Answer

    Solution

    Bellman-Ford handles negative weights and detects negative cycles; Dijkstra cannot handle negative edges.

    Practice Next
    ask-question