[Solved] Could someone explain this recursive function? [closed]
Going by the if statements: fib(0) = 0 fib(1) = 1 fib(2) = fib(2-1) + fib(2-2) = fib(1) + fib(0) = 1 + 0 = 1 fib(3) = fib(3-1) + fib(3-2) = fib(2) + fib(1) = fib(2-1) + fib(2-2) + 1 = fib(1) + fib(0) + 1 = 1 + 0 + 1 = 2 … Read more