Skip to main content
13 events
when toggle format what by license comment
Jun 21, 2019 at 15:38 comment added user339013 Let us continue this discussion in chat.
Jun 21, 2019 at 15:28 comment added user339013 @Robert i got your point
Jun 21, 2019 at 15:22 comment added Robert Harvey @who: Have a look here: geeksforgeeks.org/tail-recursion. It contains a Factorial example.
Jun 21, 2019 at 15:17 comment added Robert Harvey @who: This isn't a debate on the relative merits of recursion vs. iteration. I assume you know what tail recursion is?
Jun 21, 2019 at 15:06 comment added user339013 have you tried 100 factorial with recursion?? without recursion it is possible. similar algorithm with recursion and python complains max recursion depth exceeded error (correct me if i am wrong)
Jun 21, 2019 at 15:04 comment added Robert Harvey @who: Normally that doesn't happen unless you have an infinite recursion error.
Jun 21, 2019 at 14:59 comment added user339013 what about recursion max depth exceeded error? using iterators may be clumsy but seeing it does just fine
May 6, 2019 at 16:29 comment added Robert Harvey Sure, but not nearly as elegantly. As you already know, any recursive algorithm can also be solved iteratively. You just need to provide your own stack.
May 5, 2019 at 18:35 comment added Deduplicator Naturally, this problem is trivially solved with the same number of iterations instead.
May 3, 2019 at 21:03 vote accept João Areias
May 2, 2019 at 22:37 history edited Robert Harvey CC BY-SA 4.0
added 62 characters in body
May 2, 2019 at 22:25 history edited Robert Harvey CC BY-SA 4.0
added 52 characters in body
May 2, 2019 at 22:20 history answered Robert Harvey CC BY-SA 4.0