Quiz on time and space complexity

void pat(){
//executes log (input size) times
for (int i = 2; i <=n; i = pow(i, c)) {
System.out.print("")
}
//Here fun is sqrt or cuberoot or any other constant root
//executes log n times
for (int i = n; i > 1; i = fun(i)) {
System.out.print("
")
}
}
a) O(N LogN)
b) O(N^3)
c) O(N^2)
d) LogLog N
Answer is d) LogLog N

I have doubt in this question. How to calculate time complexity in this case?

In this course time complexity lectures are not enough.

Hey @asif_h

image

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

In case 2 how n ^(1/k^(logk(logn))) comes

Assume looks take m iterations to reach to 1

Then n^(1/k^m)=1
=> log(n) ==k^m
=>Logk(log(n))=m