Time complexity

What is the timecomplexity of thefollowing program:
void fun(int n) {
int i =1;
while(i<n) {
int j = n;
while(j>0)
j = j/2;
i = 2*i;
}

1 Like

The time complexity of the program : O(log2n)

1 Like