Question DSA-GRAPH-0049
MediumWhich algorithm finds shortest paths from one source when some edges have negative weights (but no negative cycles)?
- A.
Prim
- B.
Bellman–Ford
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Graphs question
Which algorithm finds shortest paths from one source when some edges have negative weights (but no negative cycles)?
Prim
Bellman–Ford
Sign up free to see the answer and a step-by-step explanation.
BFS
Dijkstra