A. | n |
B. | log n |
C. | nn |
D. | n2 |
Answer : A Explanation :
Let us find what is T(4), T(5), T(6) is.
T( 4) = T(3) + T(2) - T(1) = 3 + 2 - 1 = 4
T(5) = T(4) + T(3) - T(2) = 4 + 3 - 2 = 5
T(6) = T(5) + T(4) - T(3) = 5 + 4 - 3 = 6
By induction it can be proved that T(n) = n. Hence order is n.
|
|
Option: A Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. |