Multiple Choice
The following fibonacci function calculates the nth Fibonacci number recursively: In [1]: def fibonacci(n) :
) ..: if n in (0, 1) : # base cases
) ..: return n
) ..: else:
) ..: return fibonacci(n - 1) + fibonacci(n - 2)
) ..:
Which of the following statements is false?
A) Because fibonacci is a xe "recursion:recursive call"recursive function, all calls to fibonacci are recursive.
B) Each time you call fibonacci, it immediately tests for the xe "base case"base cases-n equal to 0 or n equal to 1, which the fibonacci function tests simply by checking whether n is in the tuple (0, 1) .
C) If a base case is detected, fibonacci simply returns n, because fibonacci(0) is 0 and fibonacci(1) is 1.
D) Interestingly, if n is greater than 1, the xe "recursion:recursion step"recursion step generates two recursive calls, each for a slightly smaller problem than the original call to fibonacci.
Correct Answer:

Verified
Correct Answer:
Verified
Q1: Which of the following statements a), b)
Q2: What should the question mark (?) in
Q4: Which of the following statements a), b)
Q5: Which of the following statements a), b)
Q6: Which of the following statements a), b)
Q7: An algorithm that tests whether the first
Q8: Which of the following statements about the
Q9: Which of the following statements about binary
Q10: Suppose an algorithm is designed to test
Q11: Suppose you have an algorithm that tests