Skip to content

Instantly share code, notes, and snippets.

@Oakhurst
Created June 21, 2012 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Oakhurst/2966380 to your computer and use it in GitHub Desktop.
Save Oakhurst/2966380 to your computer and use it in GitHub Desktop.
How I learned to understand recursion
(define (fib n)
(cond ((= n 0) 0)
((= n 1) 1)
(else (+ (fib (- n 1))
(fib (- n 2))))))
(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