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.