作者热门文章
- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
如果在 Breadth-FirstSearch(BFS) 算法中使用堆栈而不是 queueq 会发生什么?
pseudocode of BFS with queue:
BFS(node)
{
queue <- node
while queue not empty
v <-- queue
print v
for each child c of v quequ <-c
}
最佳答案
在这种情况下它变成了深度优先搜索
关于algorithm - 如果在 Breadth-FirstSearch(BFS) 算法中使用堆栈而不是 queueq 会发生什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22950114/
如果在 Breadth-FirstSearch(BFS) 算法中使用堆栈而不是 queueq 会发生什么? pseudocode of BFS with queue: BFS(node)
我是一名优秀的程序员,十分优秀!