Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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



Isn't that what I said?


My bad. Written communication is confusing - your comment sounded incredulous.

EDIT: In retrospect, you did mention you find it interesting - don't know how it jumped out as incredulous.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: