Created
November 4, 2012 18:53
-
-
Save enigmaticape/4013039 to your computer and use it in GitHub Desktop.
Recursive Fibonacci in Scheme, a snippet from SICP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (fib n) | |
(cond ((= n 0) 0) | |
((= n 1) 1) | |
(else (+ (fib (- n 1)) | |
(fib (- n 2)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From a discussion of the solution to SICP exercise 1.11 at http://www.enigmaticape.com/blog/sicp-exercise-1-11-iterative-function-fn/