campus placement AMCAT Mock Test Algorithms Asymptotic Worst Case Time and Time Complexity Introduction
The time complexity of function given below with constants is
Void fun(int a[], int n)
{
int i;
printf(“%d”, n);
for(i=0; i { printf(“%d”,a[i]); } printf(“n”);
1
O(1)
2
O(n)
3
O(logn)
4
O(n2)