我无法理解为什么这段代码的时间复杂度为O(logn):
double n; /* ... */ while (n>1) { n*=0.999; }
至少它在我的学习资料中这么说.
c big-o loops time-complexity while-loop
big-o ×1
c ×1
loops ×1
time-complexity ×1
while-loop ×1