engineering recuitment NIC NIELIT Scientist B 2023 Mock Test Algorithms Asymptotic Worst Case Time and Time Complexity Asymptotic Notations
What is the time complexity of the following code?
int temp = 0;
for (int i = n; i > 0; i /= 2)
for (int j = 0; j < i; j++)
temp++;1
O(n)
2
O(n2)
3
O(log n)
4
O(n log n)