how to calculate the complexity of :
7T(n/2)+a(n^2)
Time complexity(from quiz on divide and conquer)
u can simplly use the subsitution method
like T(n)=7t(n/2)+a(n^2)
t(n/2)=7t(n/4)+a(n/2)^2
t(n/4)=7t(n/8)+a(n/4)^2
t(1)=(7^1+7^2…)+…
like this
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
I haven’t got your answer yet. My doubt is not cleared as I am not able to understand how to calculate it
Hi Ashutosh,
If you are unable to understand the approach or your doubt isn’t resolved then please follow up on the thread. I marked your doubt resolved as you were not responding to this since last 5 days.
it just that u are checking for the different value of n like n
n/2
n/4
there will be one time when n became 1 then no futhur instruction are to be executed
and after this the value of Rhs will be cancelled with the LHS value of 2nd statement which i mentiond above so u left with and let it take k steps
T(n)=(7 +7^2+7^3…7^k)+an^2(1+1/2+1/4…)
u have to just sinmply this in n and this is ur tc