Regarding the ques

Q14) Find complexity of the following

void pat(){

for (int i = 2; i <=n; i = pow(i, c)) {

System.out.print("*")

}

//Here fun is sqrt or cuberoot or any other constant root

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

sir, could you please help me in finding its time complexity though I look for the solution but not able to understand it ???

Hello @gargshivam2001 according to me what i think it should be Nlog(N) but it can vary with square or cube roor function.
if you have any other doubt you can ask here:
Happy Learning!!

but according to the answer key , it is loglog(n) ???
so what is the right answer ???

*answer key of coding blocks assignment

Hello @gargshivam2001 yes i told you it can vary according the square root and cube root function if it is loglog(n) then they must have written the square root funuction in the optimised way only.
loglog(n) this is correct.
Happy Learning!!

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.