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

silverlight - Applying a style to ItemContainerStyle in C# -

c# - NullReferenceException in MySqlClient.NativeDriver -

php - Updating recent updates - Problem in procedure - Any other approach? -