Created
May 9, 2016 15:48
-
-
Save beala/25af7708a21237f39e51cc0d80d0bffe to your computer and use it in GitHub Desktop.
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
val memoFib: Int => Int = { | |
Stream.from(0).map{ | |
case 0 => 0 | |
case 1 => 1 | |
case n => memoFib(n-2) + memoFib(n-1) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment