Space time complexity Quiz Q14

How does addition of log N times for loop 1 and log N times for loop 2 give log log N as the answer?

Find the time complexity of the given code.

void pat(){

for (int i = 2; i <=n; i = pow(i, c)) {
print("*")
}

//Here fun is sqrt or cuberoot or any other constant root
for (int i = n; i > 1; i = fun(i)) {
print("*")
}
}

@Samarth_Shah pow function and fun function also takes logn time so final complexity
log(logn)

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.