engineering recuitment NIC NIELIT Scientist B 2023 Mock Test Algorithms Asymptotic Worst Case Time and Time Complexity Introduction
What is the time complexity of the following fragment of code
void testbook(int n ) {
int i, j, k;
for(i=0; i for(j=i; j≤n-1; j++) { for(k=1; k≤n; k=k*2) { printf(“Hello Testbook”) } } } }
1
O(n log n )
2
O(n2 log n )
3
O(n3 log n )
4
O(n3)