java - complexity of simple algorithm -


i have following algorithm dont know its' complexity. me? input size n.

int x = n; while (x > 0) {     system.out.println("value is" + x);     x = x/5; } 

thanks lot!

in each iteration x divided 5. how many iterations take x become lower 1 (and therefore 0)?

the answer log5(n) (logarithm base 5 of n), o(log(n)).


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -