Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
9
Task/Fibonacci-sequence/Java/fibonacci-sequence-5.java
Normal file
9
Task/Fibonacci-sequence/Java/fibonacci-sequence-5.java
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
public static long fibTailRec(final int n)
|
||||
{
|
||||
return fibInner(0, 1, n);
|
||||
}
|
||||
|
||||
private static long fibInner(final long a, final long b, final int n)
|
||||
{
|
||||
return n < 1 ? a : n == 1 ? b : fibInner(b, a + b, n - 1);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue