Q.

return fibo_terms[n]

A. o(1)
B. o(n)
C. o(n2)
D. exponential
Answer» B. o(n)
Explanation: to calculate the nth term, the for loop runs (n – 1) times and each time a for loop is run, it takes a constant time.
3.5k
0
Do you find this helpful?
36

Discussion

No comments yet