Subject / 421 questions

Programming MCQs

Page 3 of Programming multiple-choice questions with answers. Tap an option to check yourself.

Page 3 of 22

Question 42 Data Structures

Why can Dijkstra’s shortest-path algorithm give wrong results on a graph with negative edge weights?

Correct answer C. It finalises a vertex's distance when the vertex is removed from the queue, assuming later paths cannot be shorter

Open question
Advertisement
Advertisement
Advertisement