标签: time-complexity
s = n while (s>1) if (s is even) s = s/2 else s = s+1
我知道如果代码每次都减半,那就是O(logn),但我不确定if even / else语句是如何改变的。感谢