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

What is worse do you mean? Was I wrong about something?


No. You were right that with large inputs the program stack will blow up. However, the definition of tail recursive is if a function returns the value of a recursive call or does not make a recursive call and the factorial and Fibonacci functions weren't even tail recursion in that sense. Ie. it didn't matter where they were implemented, they would still blow up the stack anyway. The "worse" is because they will always blow the stack without some drastic optimization.




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

Search: