Machine-translated by Google. Questions are authored in English.
Top

Discussion

Why is backtracking necessary in depth first search?

  • A.The algorithm must return to test states it skipped earlier
  • B.The frontier must be reordered after each expansion
  • C.The path cost must be recomputed from the root each time
  • D.A branch may be exhausted without containing any goal

Answer: D

When a branch runs out of unexplored successors without reaching a goal, the search must return to the most recent node with alternatives remaining and try the next one. That is exactly what a stack, or recursion, provides automatically. No states are skipped, the frontier order is fixed, and costs are accumulated incrementally. An algorithm whose control structure is provided free by the language's call stack is unusually simple to implement, which is part of its durability.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.