其他分享
首页 > 其他分享> > Backtracking VS DFS

Backtracking VS DFS

作者:互联网

Backtracking VS DFS

Backtracking

If there are multiple paths to reach node 'A', in backtracking you visit that 'A' node multiple times through different paths.

DFS

However in DFS you only hit the node once even though there are multiple ways to reach the node.
Thus in DFS you don't actually care about the state of the variables in following a particular path in the recursion tree, however, you care about them in the backtracking.

标签:node,paths,multiple,DFS,VS,Backtracking,backtracking
来源: https://www.cnblogs.com/qianxinn/p/16662296.html