← Quiz: Approaching DSA Interview Problems: all 10 questions
Quiz: Approaching DSA Interview Problems · Question 7 of 10
"Find the fewest moves in a grid where every move costs the same." Which algorithm fits?
"Find the fewest moves in a grid where every move costs the same." Which algorithm fits?
- A.BFS
- B.Heap sort
- C.Kadane's algorithm
- D.Binary search on the answer
Answer & explanation
Correct answer: BFS
BFS visits cells in order of distance when all edges have equal cost.
Can you get the rest right without peeking?
Take the timed Quiz: Approaching DSA Interview Problems quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →