597 views

2 Answers

2 votes
2 votes

1) 1^2+2^2+3^2+.......n^2=  n(n+1)(2n+1)/6

So it's O(n^3)

2) 1+1/2+1/3+......1/n =log no 

So it's O (log n) 

3)1/2+1/4+1/8+.... 1/2^n 

4) x+x^2+x^3+.......x^x

​Here dominating term is x^x so it O( x^x) 

5) x+2x+...... To infinity 

Here O(infinity) 

6)  for n! it's order of O(n^n) 

Log n! = O of Log n^n and ( log n!)! = O((log n^n) ^ log n^n) 

I'm not sure about 3 and 6
0 votes
0 votes
3-i think .5^n

4-x^n

 

Apply gp..

Related questions

0 votes
0 votes
0 answers
1
Naveen Kumar 3 asked Nov 3, 2018
973 views
Suppose, we have an array of n elements. find the time complexity to search two elements x, y such that:-a) x+y < 100b) x+y 1000Also, state the algorithm/approach for th...
3 votes
3 votes
1 answer
2
sumit_kumar asked Jun 25, 2017
3,155 views
what is time comlexity procedure for following recursive equation by substitution method:T(n)= T(n-1)+T(n-2) , if n>=2 =1 , if n=1; =0 , if n=0.
1 votes
1 votes
1 answer
3
Akriti sood asked Jan 23, 2017
1,310 views
What is the time complexity of the following function foo() void foo() { int i, j; for(i = 1; i <= n ; i++) for(j = i; j <= log(i); j++) printf(“gate”); } what is the...
2 votes
2 votes
1 answer
4