Created
April 11, 2016 04:34
-
-
Save haydarai/030493cb9c7d8a502daf49bd0b291d87 to your computer and use it in GitHub Desktop.
fibonaccip
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
ArrayList<int> fibonaccip = new ArrayLiatt<int>(); | |
fibonaccip.add(1); | |
int ip1 | |
for (int i = 0; i < n; i++) { | |
int ip1; | |
if ((i - p - 1) > 0) { | |
ip1 = 0; | |
} else { | |
ip1 = i - p - 1; | |
} | |
int number = fibonaccip.get(i - 1) + fibonaccip.get(ip1); | |
fibonaccip.add(number); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment