while(n>x) x*=x;
The correct answer is log(log(n)), I can see the log(n) since x^k>=n is when the while loop will stop. so I got to log(n), what am I missing?
P.S: it is given that x=2.
Aucun commentaire:
Enregistrer un commentaire