3 ms·
> DFS and BFS can be expressed by a single algorithm that differs only in the behavior of the "queue." Correct me if I am wrong, but the naive non-recursive DF
by irahul 15y ago
> DFS and BFS can be expressed by a single algorithm that differs only in the behavior of the "queue."
Correct me if I am wrong, but the naive non-recursive DFS and BFS differ only in the implementation of queue.
https://gist.github.com/1791284 https://gist.github.com/1791284