Skip to content

Instantly share code, notes, and snippets.

@rashedcs
Created December 23, 2016 17:35
Show Gist options
  • Save rashedcs/619c54c3fb380c519474b4d2633f4682 to your computer and use it in GitHub Desktop.
Save rashedcs/619c54c3fb380c519474b4d2633f4682 to your computer and use it in GitHub Desktop.
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