Q14. 5. TIme and Space
Find the time complexity of the given code.
void pat(){
for (int i = 2; i <=n; i = pow(i, c)) {
//Print statement - O(1) operation
}
//Here fun is sqrt or cuberoot or any other constant root
for (int i = n; i > 1; i = fun(i)) {
//Print statement - O(1) operation
}
}
how can we get O(log logn) as our time complexity?? Isn’t it supposed to be O(log n) only??