Row*_*awn 6 algorithm nodes depth-first-search
我正在尝试理解维基百科上的深度限制搜索算法,我试图找出扩展节点的确切含义.我试图寻找答案,但我得到的是更多的算法,它们表明必须扩展节点.
具体来说,stack := expand (node)关于整个功能的说法是什么?
DLS(node, goal, depth)
{
if (node == goal)
return node;
push_stack(node);
while (stack is not empty)
{
if (depth > 0)
{
stack := expand (node)
node = stack.pop();
DLS(node, goal, depth-1);
}
else
// no operation
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3615 次 |
| 最近记录: |