#C Complexity of Algorithms Big OComplexity

后端 未结 0 1233
误落风尘
误落风尘 2020-11-21 20:20

I\'m a little bit confused about complexity for this code :

while(x!=0)
x=x/2;

This instruction have complexity O(logx) because T(x)=log2(x)

相关标签:
回答
  • 消灭零回复
提交回复
热议问题