Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
A non-programming recursion explanation (everything2.com)
2 points by rayvega on June 16, 2010 | hide | past | favorite | 4 comments


That implementation had no exit conditions on the recursion, so after the child fell asleep, my computer went to sleep.


It appears that the exit condition is that you're a little weasel, or your mom finishes the story.

Clearly, the original mom could have optimized by telling a story about a little weasel that couldn't get to sleep.


... except that's not recursion.


No, but it does a good job of explaining the "flow" of a recursive function. It's like doing a manual trace of factorial(4) without needing to know about coding.




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

Search: