Question: What is the worst-case scenario for the following function? int function(int a, int b) { int c = 0; for (int i=0; i

What is the worst-case scenario for the following function?

int function(int a, int b) { int c = 0; for (int i=0; i 

Select one:

a. O(a)

b. cannot be determined

c. (b)

d. O(n)

e. O(n*m)

f. O(b)

g. (n2)

h. O(n2)

i. O(a*b)

j. (a*b)

k. O(a+b)

l. (n)

m. O(3+ab)

n. none of these

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!