Sunday, 15 September 2013

how to calculate the time complexity for the following code?

how to calculate the time complexity for the following code?

For (int i=1; i <=n;i/=2){
System.out.println(i);
}
For the time complexity about the above coding, is ot log (n)?
Thanks!

No comments:

Post a Comment