Posted in haskell Software

Fibonacci numbers: the slow way or the fast and lazy way

Fibonacci numbers are a series of numbers such as 1,1,2,3,5,8,13,21,34,55,….

You can write a simple program, such as the one given below, in any language such as perl, python, ruby, javascript, php, java, haskell etc.

slowFib 0 = 0
slowFib 1 = 1
slowFib n = slowFib (n - 2 ) + slowFib (n - 
... read more
Continue Reading...