1,813 views

2 Answers

Best answer
1 1 vote
n+(n-1)+(n-2)+.....+1=$\frac{n \times (n+1)}{2}$
selected by
0 0 votes

We can use Master Theorem for Decreasing function here.

T(n) = a* T(n-b) + n^k

Here, a=1>0 , b=1>0 and k=1

so then, O(n^k+1) i.e O(n^2)   

Position:
Show:

Related questions

3 3 votes
1 answers 1 answer
640
640 views
himanshu2001 asked Sep 29, 2024
640 views
Can Somebody help me solve these recurrences?What is the method generally employed to solve questions of this type?Taken from https://jeffe.cs.illinois.edu/teaching/algor...
1 1 vote
0 0 answers
1.4k
1.4k views
srestha asked May 19, 2019
1,448 views
Let $A(n)$ denotes the number of $n$ bit binary strings which have no pair of consecutive $1’s.$ what will be recurrence relation for it and what will be it’s Time Comple...
1 1 vote
1 1 answer
1.7k
1.7k views
VikramRB asked Jan 20, 2019
1,679 views
What is the time complexity of the following recurrence relation and step to derive the same$T(n) = T(\sqrt{n}) + log(logn)$