Timeline for Need help understanding a recursion example in Python
Current License: CC BY-SA 3.0
3 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 26, 2014 at 21:55 | comment | added | Kilian Foth | Yes, it goes back to the start, but not quite: control flow moves to the start of another copy of the same method. It's not like running around in a circle, more like entering a car park and reaching the entrance of the next higher level. | |
| Jul 26, 2014 at 13:07 | comment | added | Ali Mustafa | So the first time the program reaches "recurse", instead of continuing to "result", it goes back to the start and executes factorial (n-1), which also goes back to the start instead of "result" and so on? | |
| Jul 26, 2014 at 7:31 | history | answered | Kilian Foth | CC BY-SA 3.0 |