RichardWarburton / java-8-lambdas-exercises

Exercises and Answers for Java 8 Lambdas book

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fibonacci HashMap

compar opened this issue · comments

jdk8
f.fibonacci(15);
result:
{0=0, 1=1, 2=1, 3=2, 4=3, 5=5, 6=8, 7=13, 8=21, 9=34, 10=55, 11=89, 12=144, 13=233}

cache = new HashMap<>(); // Lack 14,15 why?
cache = new TreeMap<>(); // use TreeMap ok