Created
December 14, 2017 11:49
-
-
Save teru01/62f889ae46afb9b54a0703ecc9c923be 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
int fibonacci(int n, int *p){ | |
if(n == 0) { | |
p[0] = 0; | |
return p[0]; | |
}else if(n == 1){ | |
p[1] = 1; | |
return p[1]; | |
}else{ | |
p[n] = fibonacci(n-1, p) + fibonacci(n-2, p); | |
return p[n]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment