Q. return fibo_terms[n]

  • (A) o(1)
  • (B) o(n)
  • (C) o(n2)
  • (D) exponential
πŸ’¬ Discuss
βœ… Correct 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.

Explanation by: Mr. Dubey
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.

πŸ’¬ Discussion

πŸ“Š Question Analytics

πŸ‘οΈ
428
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
94%
Success Rate