Question DSA-GRAPH-0050
MediumHow does Bellman–Ford detect a negative-weight cycle?
- A.
If Dijkstra fails
- B.
If the graph has more edges than vertices
- 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
How does Bellman–Ford detect a negative-weight cycle?
If Dijkstra fails
If the graph has more edges than vertices
Sign up free to see the answer and a step-by-step explanation.
If any edge can still be relaxed after V − 1 rounds
It cannot