While(n>1)
{
n=n/20;
n=n/10;
}
I tried like this =>
Here, n = n/200 which means that N is getting reduced each time by a factor of 200. so, time complexity = O(log base 200 N)
While(n>1)
{
n=n/20;
n=n/10;
}
I tried like this =>
Here, n = n/200 which means that N is getting reduced each time by a factor of 200. so, time complexity = O(log base 200 N)
Yes, n gets reduced to 1/200 each time in the loop.
So, this loop would run log 200 n times.
Hence, time-complexity = O(log 200 n).