What is the problem size of the code


Problem

Consider the following Python code to print out a Fibonacci sequence.

def fib(number_of_terms):
counter = 0
first = 0
second = 1
temp = 0

while counter <= number_of_terms:
print(first)
temp = first + second
first = second
second = temp
counter = counter + 1

• What is the problem size of the code? Explain your answer.
• Derive the Big-O of the code's time complexity. Explain your derivation.

Request for Solution File

Ask an Expert for Answer!!
Python Programming: What is the problem size of the code
Reference No:- TGS03256837

Expected delivery within 24 Hours