Practice
Learn
← Quit
0 / 0 correct
Algorithms
Hard
1 of 20
How does Bellman-Ford detect a negative cycle?
A
It checks if the graph is a DAG
B
After V − 1 rounds of relaxing all edges, if any edge can still be relaxed, a negative cycle is reachable
C
It runs Dijkstra twice
D
It counts edges with negative weights