Question #186746

Solve the following recurrence relation using Recurrence Tree Method.

𝑇(𝑛) = ∫ 1 if n+1

∫T(n/2) + n if n >1


Show all the steps.


Expert's answer

The recursion tree for the given recurrence relation is-

T(n)βˆ’d↓T(n2)βˆ’d↓T(n4)βˆ’d↓T(1)βˆ’d↓T(n)- d\\ \downarrow \\ T(\dfrac{n}{2})-d \\\downarrow\\ T(\dfrac{n}{4})-d \\\downarrow\\ T(1)-d \downarrow


we go like n,n2,n4,n8...1n,\dfrac{n}{2},\dfrac{n}{4},\dfrac{n}{8}...1


    or 2k=n,k=log2n2^k=n, k=log_2n


So we sum d+d+d.. for log2nlog_2n terms complexity =0(log2n)=0(log2n)=0 (log_2n)=0(log_2n)


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS