← Quiz: Shortest Paths: all 10 questions
Quiz: Shortest Paths · Question 8 of 10
In 0-1 BFS, after relaxing an edge of weight 0 to node v, where is v pushed?
In 0-1 BFS, after relaxing an edge of weight 0 to node v, where is v pushed?
- A.To the back of the deque
- B.Into a min-heap
- C.To the front of the deque
- D.Nowhere; weight-0 edges are skipped
Answer & explanation
Correct answer: To the front of the deque
A weight-0 edge does not increase the distance, so v belongs with the nodes being processed now, at the front.
Can you get the rest right without peeking?
Take the timed Quiz: Shortest Paths quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →