top | item 44309995

(no title)

breckognize | 8 months ago

And depth first search is just a stack!

discuss

order

dietr1ch|8 months ago

Yes, but it doesn't come right away. When preferring deeper nodes for a moment you have a loop-safe Depth-first traversal, and then when simplifying things in case the Graph is a Tree you get your regular stack-based Depth-first traversal, in which if you settle for the first goal you get back a tail-call optimised DFS.