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

> > A recursive algorithm is a depth first search. Any loop that explores candidates/neighbors without sorting the candidates is a BFS.

BFS is also a recursive search. Even in the case of non-recursive search, the only difference is whether you use a queue or stack.

Apart from that, great article.



And even then, execution depends on your language and compiler.

Write a recursive BFS in Haskell and it won’t blow up the stack.


Any language with decent TCO won't do that. Python is the only big language that I can think of that doesn't do it.


Guaranteed TCO is pretty rare unfortunately.

Java, Go, JavaScript all lack it.


Actually, you are right.




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

Search: