-
Question 1: Which of the following is the value of T3(n) where T3(n) is defined as T3(n) = 5*T3(n-1) – 4*T3(n-2)
- C1*5n + C2*4n
- C1 + C2*4n
- C1*2n + C2*4n
- C1*5n + C2*(-4)n
The characteristic equation of our new differential equation would be:So, the homogeneous solution to this equation shall be:
As we have defined A(n) = T3(n), the final answer is: -
Question 2: Determine the value of initial condition F(1) in a way that we can have F(n) = (n+2)! as the solution to the following given recursive function:
F(n) = (n+1) * F(n-1) + (n+1)!
- 3
- 4
- 6
- 2
The last step (stop point) in iteration method is when we reach the initial condition F(1); therefore, we let k = n-1, and the non-recursive form would be:
Finally, as we shall see, the value of F(1) is: -
Question 3: What is the time Complexity of T(n) = 4* T(n/2) + n * log(n!).
- θ(n * log n)
- θ(n2)
- θ(n2 * log n)
- θ(n2 * log2 n)
We can solve this by master theorem. In order to apply master theorem here, we have f(n) = n2 * log(n), and the parameters a (the number of sub-problems), b (the reduction factor), and C equal to 4, 2, and 2, respectively; so, θ( nlogba ), is of θ( n2 ) which lies in the same complexity class of θ( nC = 2 ); therefore, the given recursive function is belong to the case 2 of master theorem. In according to master theorem, T(n) would be of following order: -
Question 4: Which one gives the best estimation of T(n) complexity?
T (n) =
* T(n/2)+ n2 √n+1. - θ( n2 * √n * log n )
- O( n2 * √n+1 * log n )
- θ(
) - θ(
) - O( n2 * √n ).
, and ; so, we can simplify the recursion function as following: -
Question 5: Which asymptotic boundary is not correct for T (n) = T (n/4) + T (3n/4) + n ?
- O( nlog4/3 2 )
- Ω( n )
- O( n * log(n) )
- None of above
The length of the branches of the recurrence tree cannot be less than hr, and neither can be more than hL; so the following estimations can be inferred:
Recommended Articles