-1

I'm new to Divide and Conquer. I would like to know how to find out the running time of this calculation?

What exactly do I have to pay attention to and how do I proceed?

n=1 runningtime = O(1)

  • If you click on `master-theorem` tag > Learn more, you get to the Wiki page of Master theorem, which also contains examples for running time: https://en.wikipedia.org/wiki/Master_theorem_(analysis_of_algorithms)#Examples – Silviu Burcea May 27 '21 at 10:41

1 Answers1

1

so lets see the calculation for this :

T(n) = 4T(n/4) + n * sqrt(n)
expanding for sum k steps it will be like
T(n) = 4^k[T(n/4^k)] + n * sqrt(n) * {sqrt(1/4)+sqrt(1/16)....}
here {sqrt(1/4)+sqrt(1/16)....} is Geometric progression
if we take k=log4(n) //here base is 4
T(n) = n * [T(1)] + n * sqrt(n)*{1-[2/sqrt(n)]}
T(n) = n * [T(1)] + n * sqrt(n) -2 * n

you still can use

Master theorem

T(n) = aT(n/b) + f(n).

If f(n) = Θ(n^d), where d ≥ 0, then

T(n) = Θ(n^d) if a < bd,
T(n) = Θ((n^d)log n) if a = bd,
T(n) = Θ(n^(logba)) if a > bd


yes the ans is O(n^3/2)
{sorry could not comment due to low reputation}
Dhananjay
  • 26
  • 6