Like asking "what is 4?" by asking two friends who each ask two more friends.
To compute fib(4), we need fib(3) + fib(2). Each of those needs more calls.
> fibNaive(4) > fibNaive(3) > fibNaive(2) > ...
Like asking "what is 4?" by asking two friends who each ask two more friends.
To compute fib(4), we need fib(3) + fib(2). Each of those needs more calls.
> fibNaive(4) > fibNaive(3) > fibNaive(2) > ...
Sign in to cast your vote
Sign in to share your feedback and join the discussion.