0

I need some advice on how to determine the runtime of this loop :

s=0 
 for ( i=1 , i <= 2^m ; i=i*2 ) { 
   s++ 
}
return s 

With

$C_1$ = actions performed once before entering the loop and
$C_2$ = actions performed one after entering the loop,

I see that $T(m) = C_1 + C_2 \cdot 2^m$.

How can I determine $T(m)$?

Raphael
  • 72,336
  • 29
  • 179
  • 389
Guest
  • 1
  • 1

0 Answers0