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
}
Why does the loop run logN times?