retagged by
496 views

1 Answer

Best answer
6 votes
6 votes
Answer would be $O(nlogn)$.

Because outer loop runs $(n/2)$ times. Inner loop runs $O(logn)$ times. Hence total time is $O(nlogn)$.
selected by

Related questions

0 votes
0 votes
2 answers
1
worst_engineer asked Jan 25, 2016
1,462 views
now , the question says , worst case time complexity. So, in the worst case , the inner loop condition is not satisfied , so , won't it be O(n2) ?
1 votes
1 votes
1 answer
3
3 votes
3 votes
1 answer
4
gate-17 asked Aug 7, 2016
2,808 views
consider the following functions f(n)=log*(log n) , g(n)=log(log* n) relations between these 2 function. please help