On a clear grid, why check the step count rather than the exact path?
- A.The exact path is impossible to compute
- B.There can be several shortest paths of the same length — Dijkstra may pick a different valid one
- C.Step count is easier to type
- D.The path is always the same
Answer Why?
In a for/else loop, when does the else block run?
- A.Every time, always
- B.Only if the loop finishes without hitting break
- C.Only if break is hit
- D.Never
Answer Why?
How many lines of the Navigator's own code change to use Dijkstra instead of Manhattan?
- A.Dozens — you rewrite drive_path
- B.Zero — only the import and constructor change; the Navigator code is untouched
- C.Every line that mentions a path
- D.You must build a new Navigator class
Answer Why?
The swap works because Dijkstra is 'better' than Manhattan. True or false?
- A.True — better classes are always swappable
- B.False — the swap works because they share the same interface, not because of quality
- C.True — Manhattan is broken
- D.False — you cannot swap classes in Python
Answer Why?