Question

Does Dijkstra's algorithm work for graphs with both negative and positive edge weights?

A Yes, it works for graphs with both negative and positive edge weights.
B No, it only works for graphs with non-negative edge weights.
C Yes, but it requires modifications to handle negative weights.
D No, it only works for graphs with positive edge weights.
E Yes, but it can result in incorrect shortest paths if negative weights are present.
Practice Next

Hey! Ask a query

🎓
Think You're Ready for RBI Grade B?
RBI Grade B 2026 Phase 1 Memory Based Paper
  • 200 Questions with Detailed Solutions
  • Section-wise Coverage (GA, English, Quant & Reasoning)