Question: 3. Consider the following functions and answer the questions. [6 marks] def functionA(n): m=n*n for i in range(m): print(hello world) def function(n): if n>1000: for

 3. Consider the following functions and answer the questions. [6 marks]

3. Consider the following functions and answer the questions. [6 marks] def functionA(n): m=n*n for i in range(m): print("hello world") def function(n): if n>1000: for j in range(n): else: functionA(nn) a) Give the tight asymptotic time complexity of functionA using Big-O notation. [2 marks] b) Give the tight asymptotic time complexity of functionB using Big-O notation. [3 marks] c) If n=5, how many "hello word" are printed in functionB? [3 marks]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!