7. (25 points) T(n)-4T(n/2)+cn and T(1)-c for a recursive algorithm. Determine t
ID: 3601126 • Letter: 7
Question
7. (25 points) T(n)-4T(n/2)+cn and T(1)-c for a recursive algorithm. Determine the polynomial T(n) for this recursive algorithm using the Recursion Tree Method. (a) Fill in the table (drawing the tree may help you fill in the table entries). (b) Then add total work done across levels and simplify to produce a polynomial expression for T(n), (3) State the complexity of the algorithm You will need to use the following result, where a and b are constants and a summatiorn simplification result from Appendix A of the text. level Work done by each recursive execution, excluding the recursive calls Total work done by the algorithm at this level Level number Total # of recursive executions atrecursive this level Input size to each execution 2 2 The level just above thee base case level Base case level T(n)Explanation / Answer
Table
-------------------
0 1 n cn cn
1 4 n/2 cn/2 2cn
2 16 n/4 cn/4 4cn
logn-1 4logn-1 2 cn/2logn-1 cn2/2
logn 4logn 1 c cn2
b) If we add the values in the last column, the polynomial will be
cn(1+2+22+....+2logn) = 2logn+1cn-1 = 2cn2-1
c) The complexity is theta(n2)
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.