• edited by
382 views
0 0 votes

What is the time complexity?

i=n;
while(i>0)
{
    k=1;
    for(j=1;j<=n;j+=k)
    k++;
    i=i/2;
}

a) O(n2)

b) O(n logn)

c) O(log2n)

d) O(logn n1/2

Please log in or register to answer this question.

Position:
Show:

Related questions

1 1 vote
0 0 answers
625
625 views
Psnjit asked Jan 29, 2019
625 views
Time complexity of Prim's algorithm for computing minimum cost spanning tree for a complete graph with n vertices and e edges using Heap data structure is-1. (n+e)*log^2n...
1 1 vote
1 1 answer
1.0k
1.0k views
0 0 votes
0 0 answers
737
737 views
0 0 votes
2 2 answers
1.4k
1.4k views
Nidhi Budhraja asked Nov 29, 2018
1,440 views
What is the time complexity of T(n) = T(n/3) + T(n/9) +n?