c++ - Big-O notation Help -


while (n >= 1)  n /= 2; 

i unable big-o notation this

i'll follow pointy's advice sake of exposition.

try 8.

4 2 1 0: 4 iterations. 

try 32.

16 8 4 2 1 0: 6 iterations. 

try 66.

33 16 8 4 2 1 0: 7 iterations. 

so… how initial numbers changing, , how numbers of iterations changing?


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -