Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

fib(180) without caching would take billions of years to complete, so "slow" is an understatement.


Or you write an iterative version of it that will not only be the simplest solution, it will be fast enough to compute fib(10000). There are constant time ones IIRC, but if someone comes up with such a solution in an interview without knowing it from before, they are probably over qualified for any job that uses the Fibonacci sequence as an interview question.


Billions of years is a gross understatement.


cause o^2n?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: