Created
December 23, 2016 17:35
-
-
Save rashedcs/619c54c3fb380c519474b4d2633f4682 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
int memo[100]; | |
int fibo(int n) | |
{ | |
if(n<=2) return 1; | |
else if(memo[n]!=-1) return memo[n]; | |
else return memo[n] = fibo(n-1) + fibo(n-2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment