Explain Time complexity of following code

前端 未结 0 595
醉酒成梦
醉酒成梦 2020-11-22 08:10

Please explain its time complexity with steps:-

int a = 0, i = N; 
while (i > 0) { 
    a += i; 
    i /= 2; 
} 
相关标签:
回答
  • 消灭零回复
提交回复
热议问题