Question DSA-QUE-0068
HardWhy does Dijkstra's algorithm need a priority queue rather than a FIFO queue?
- A.
FIFO queues can't hold vertices
- B.
It must always expand the vertex with the smallest tentative distance, not the oldest
- C.
Priority queues are faster for BFS
- D.
It doesn't
Sign up free to see the answer and a step-by-step explanation.