标签: algorithm time-complexity
如何计算时间复杂度?
While(n>0) For j in n Count+=1 n = n/2
答案 0 :(得分:9)
O(n)。
n + n / 2 + n / 4 + ... = 2n = O(n)