3 ms·
fib(180) without caching would take billions of years to complete, so "slow" is an understatement.
by bufferoverflow 8y ago
fib(180) without caching would take billions of years to complete, so "slow" is an understatement.
- person_of_color 8y agocause o^2n?
- ummonk 8y agoBillions of years is a gross understatement.
- bjoli 8y agoOr 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.