Module 5 · Dijkstra's Algorithm
Lesson 5 · Implementing compute_path() — Knowledge Checks
Name Date
Why are all distances initialized to 999999 except the start?
Answer Why?
What does this loop leave in the variable current?
Answer Why?
Why the check `if new_distance < distances[neighbor]` before updating?
Answer Why?
What does the `if current is None` check protect against?
Answer Why?
compute_path returns [(0,0), (0,1), (0,2), (1,2), (2,2)]. How many steps is that?
Answer Why?