A. | max (f (n) ,g (n)) |
B. | min (f (n) ,g (n) ) |
C. | f (n) + g (n) |
D. | f (n) x g (n ) |
Answer : A Explanation :
By definition of order, there exists constants c1, ec2, n1, n2 such that
T (n) ≤ c1 x f (n) , for all n ≥ n1.
T (n) ≤ c2 x f (n) , for all n ≥ n2.
N = max (n1, n2) andC = max (c1, c2). So,
T (n) ≤ C x f(n) for all n ≥ N
T (n) ≤ C x g (n) for all n ≥ N
T(n) ≤ C/2 x (f(n)+g(n))
Without loss of generality, let max ( f (n), g (n)) =f(n) .
So, T (n) ≤ C / 2 (f(n) + f (n) ) ≤ C x f(n) .
So, order is f(n) , which is max (f(n), g (n) ) , by our assumption.
|
|
Option: A Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. |