[plt-scheme] Dr.Scheme freezes on (fib 100) recursion

From: Geoffrey S. Knauth (geoff at knauth.org)
Date: Fri Jan 9 10:21:55 EST 2009

On Jan 8, 2009, at 09:50, Stephen Bloch wrote:
> On Jan 8, 2009, at 1:45 AM, laa laa wrote:
>> (define (fib n)
>>  (if (< n 3)
>>      1
>>  (+ (fib (- n 1)) (fib (- n 2)))))
>
> This is one of my favorite (for classroom use) examples of algorithm  
> (in)efficiency.

Shriram asked for sound-file support.  Maybe we could hook up the  
sound of a turkey gobbling, and add a turkey to a crowd of turkeys  
gobbling every time `fib' was called not in tail position.  Sound can  
leave an impression, like the sound of the Nazgûl in Lord of the  
Rings, or the Dementers in Harry Potter.



Posted on the users mailing list.