Time complexity

what is the time complexity of function T(n) = 2×T(n/2) + 2 ?? I am getting confused in it…

Just do it for few more steps to notice the pattern, T(n) = x*T(n/x) + sum of 2^i for i from 1 to x.
hence complexity is O(n).

Oh… Yess i got It i was multiplying wrong…

I want to know what is the efficieent way to calculate time complexity by making recurrence or calculation the work in each function call?? Like we do in fibonaacii

Actually to know the complexity you have to do both!

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.