Add to Chrome
✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
What is the time complexity of following code:
int a = 0, i = N;
while (i > 0)
{
a += i;
i /= 2;
}
O(N / 2)
O(log N)
O(N)
O(Sqrt(N))
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!