Fibonacci series recursion error
Thomas Rachel
nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915 at spamschutz.glglgl.de
Sat Apr 30 05:37:22 EDT 2011
More information about the Python-list mailing list
Sat Apr 30 05:37:22 EDT 2011
- Previous message (by thread): Fibonacci series recursion error
- Next message (by thread): Fibonacci series recursion error
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Am 30.04.2011 07:35, schrieb harrismh777: > Ian Kelly wrote: >> since the fact is that if >> the function were properly coded, the call stack for fib(20) would >> never be more than 20 entries deep at any one time. > > Not so much... and much more !.... > > ... because each recursion level 'return' calls fib() twice, and each of > those calls fib() twice, and you get the point... yes - but they are called one after the other, so the "twice" call counts only for execution speed, not for recursion depth. Thomas
- Previous message (by thread): Fibonacci series recursion error
- Next message (by thread): Fibonacci series recursion error
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list