2

Apologies for this simple question. I found it in the book Algorithms by Sedgewick and Wayne.

Give a formula to predict the running time of a program for a problem of size N when doubling experiments have shown that the doubling factor is $2^b$ and the running time for problems of size N0 is T.

$$ \frac{T(2N)}{T(N)}=2^b.$$

$$ T(N_0)=T. $$

I am not sure how to proceed after that.

Yuval Filmus
  • 280,205
  • 27
  • 317
  • 514
johnson
  • 123
  • 2

1 Answers1

0

Instead of solving the question for you, let me show you what steps you need to take in order to solve this problem on your own.

Suppose that $T(1) = T_0$ and $T(2n) = C T(n)$ for all $n$.

  • What is $T(2)$? What is $T(4)$? What is $T(8)$? What is $T(2^k)$?

Now suppose that $T$ is monotone: $T(n_1) \leq T(n_2)$ whenever $n_1 \leq n_2$.

  • If $2^k \leq n \leq 2^{k+1}$, what can you say about $T(n)$?
  • Can you now deduce the asymptotic rate of growth of $T(n)$ for arbitrary $n$?
Yuval Filmus
  • 280,205
  • 27
  • 317
  • 514