Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Exponential complexity
- -- NOTE: This should never be used it is extraordinarily slow
- fib :: Int -> Integer
- fib 0 = 0
- fib 1 = 1
- fib n = fib (n - 1) + fib (n - 2)
- -- > fib 8
- -- > [0, 1, 1, 2, 3, 5, 8, 13]
Add Comment
Please, Sign In to add comment