Can someone help me with this
Consider the Java program fragments given below. Assume that n, m, and k are non-negative ints and that the method e and f have the following characteristics :
The worst case running time for e(n,m,k) is O(1) and it returns a value between 1 and (n+m+k).
The worst case running time for f(n,m,k) is O(n+m).
Determine a tight, big oh expression for the worst-case running time of the following program fragment:
for (int i = 0; i < e (n, m, k); ++i)
f (n, 10, 0);
I think that the answer is (n+m+k)*O(1)*O( n+m)?
Am I right?
Consider the Java program fragments given below. Assume that n, m, and k are non-negative ints and that the method e and f have the following characteristics :
The worst case running time for e(n,m,k) is O(1) and it returns a value between 1 and (n+m+k).
The worst case running time for f(n,m,k) is O(n+m).
Determine a tight, big oh expression for the worst-case running time of the following program fragment:
for (int i = 0; i < e (n, m, k); ++i)
f (n, 10, 0);
I think that the answer is (n+m+k)*O(1)*O( n+m)?
Am I right?
Comment