Hacker News new | ask | show | jobs
by smarx007 3377 days ago
So, it's just caching the return values of the method calls? I thought applying dynamic programming to fibonacci numbers was algo 101?

And what is -O7 level? Or, better, O7 lvl? :) Dynamic version of 45th fibonacci number (see http://www.geeksforgeeks.org/program-for-nth-fibonacci-numbe...) has the following runtime:

    ᐅ gcc -O2 fib.c -o fib && time ./fib
    1134903170
    ./fib  0.00s user 0.00s system 49% cpu 0.005 total