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
Get step-by-step solutions from verified subject matter experts
