Hacker Newsnew | past | comments | ask | show | jobs | submit | hermanbergwerf's commentslogin

Didn't read the article. I usually don't have trouble with recursion, however lately I have started to avoid it more and more often. It is true that linear solutions usually look more complex. However in my opinion they also allow better reuse of local variables. Their complexity also depends on the datastructure. Designing a linear datastructure for nested problems is sometimes possible and can allow simple non-recursive solutions which I find more elegant.


You'll find that since problems are notoriously hard to do iteratively, unless you effectively simulate recursion via a stack.


Yeah, that sounds pretty cool.


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

Search: