Recursion Tree please provide neat solution for full points

Recursion Tree please provide neat solution for full points and good feedback thanks

For each of the following recurrences, give a one-line answer to the following questions: When you construct a recursion tree of the recurrence relation, how many leaves does it have? what is the height of the tree? how many nodes does it have? T(n) = 4T(n/2)+n^2 T(n) = T(n - 1) + n T(n) = 3T (n/5) + n^3 T(n) = T(n/3) + T(2n/3) + squareroot n You may assume that T(n) = 1 for n lessthanorequalto 1

Solution

1. T(n). = 4T(n/2) + n2
a . The number of leaves is nlogba     =>nlog24 => n2 .
b . Height is log2 n.
c . Total number of nodes is 1 +4 +42+ 43+........+4h = > 4log 2n => Roughly n3


2. T(n) =T(n-1) + n
This will reduce down by 1 and we will get only 1 leaf
a . The number of leaves is 1.
b . Height is n.
c . Total number of nodes is 1 +1 + 1 +1 + upto h = > n

3. T(n). = 3T(n/5) + n3
a . The number of leaves is nlogba     =>nlog53 => n .
b . Height is log5 n.
c . Total number of nodes is 1 +3 +32+ 33+........+3h = > 3log 5n => Roughly n2

4. T(n). = T(n/3) + T(2n/3) + sqrt(n )
a . The number of leaves is max   <= n .
b . n/3 grows faster than 2n/3 so Height is log3/2 n.
c . Total number of nodes will lie between log3 n N log3/2 n. we can say roughly n

Recursion Tree please provide neat solution for full points and good feedback thanks For each of the following recurrences, give a one-line answer to the follow

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site