campus placement AMCAT Mock Test Algorithms Asymptotic Worst Case Time and Time Complexity Recurrences
The time complexity of the following C function is
|
int recursive (int n) { if (n == 2) return (1); else return (recursive (n/2) + recursive (n/2)); } |
1
O (n)
2
O (n2)
3
O (n log n)
4
O (log n)