pythagoreantree/src/Numbers.java
Jan Christian Grünhage d0e8874387 Removed RegularRandom
Regular Random Stuff is not needed anymore, standard random results in a regular random tree now anyway because of the way the pythagoras triangle is implemented
2015-02-11 10:54:17 +01:00

19 lines
445 B
Java

import java.util.LinkedList;
/**
* Created by Christian on 10.02.2015.
*/
public class Numbers {
LinkedList<Long> fibonacci = new LinkedList<Long>();
public Numbers() {
fibonacci.add((long) 1);
fibonacci.add((long) 1);
}
public long calcFibonacci(int index) {
if (index < fibonacci.size()) return fibonacci.get(index);
else return calcFibonacci(index - 1) + calcFibonacci(index - 2);
}
}