8 8 votes Let $T(n)$ be defined by $T(1) =10$ and $T(n+1)=2n+T(n)$ for all integers $n \geq 1$. Which of the following represents the order of growth of $T(n)$ as a function of $n$? $O(n)$ $O(n \log n)$ $O(n^2)$ $O(n^3)$ Algorithms isro2011 algorithms time-complexity recurrence-relation + – shivanisrivarshini 15.3k views answer comment Share Follow Print See all 4 Comments 4 4 Comments reply Nagasaikanmatha commented Sep 9, 2021 reply Follow flag alternative way T(1)=10 GROWTH – T(2)=10+4 2-->4 T(3)=10+10 3-->10 T(4)=10+18 4-->18 T(5)=10+28 5-->28 T(6)=10+40 6-->40 GROWTH IS ALMOST O(n^2) ‘’’’’’ 0 0 replyShare jacknroll commented Nov 25, 2025 reply Follow flag sometime till some n gives o(n'2) after certain n it will start giving o(n) and asymptotic analysis is for very large values 0 0 replyShare jacknroll commented Nov 25, 2025 reply Follow flag make it Tn=Tn-1+2n 0 0 replyShare EagerLearner commented Aug 18 reply Follow flag Even if its trivial,Just keep in mind that while solving recurrence problem we always need the reccurence to head to the base caseSo, if we try T(n) = T(n+1) - 2n,We see that the recurrence is going forward, toward larger and larger arguments.So we have to work with the given recurrence,Now T(n+1) = T(n) + 2n (Here it's growing downwards)So using substitution we get T(n+1) = T(n-1) +2(n-1) + 2nAnd solving the subsequent steps you get O(n^2) Link 0 0 replyShare Please log in or register to add a comment.
Best answer 16 16 votes Answer -: $C$ $T(n+1)=2n+T(n)$ $= 2n+2(n-1)+T(n-1)$ $ = 2n +2(n-1) + 2(n-2)+T(n-2) ......$ $ =2n+2(n-1) +2(n-2) ... 2(1)+T(1)$ $ =2(n+n-1+n-2 ..... 1)+T(1)$ $ = 2 \times \frac{n(n+1)}{2 }+10$ $ = O(n^{2})$ shivanisrivarshini answered May 31, 2016 • selected Apr 4, 2018 by sourav. shivanisrivarshini comment Share Follow See all 16 Comments 16 16 Comments reply Show 13 previous comments shivanisrivarshini commented May 31, 2016 reply Follow flag No i dnt know the answer 0 0 replyShare ManojK commented May 31, 2016 reply Follow flag ya it will be O(n^2 ) 1 1 replyShare Sidd1425 commented Dec 10, 2024 reply Follow flag $T(n+1) = T(n)+2n ...Given$ Value of the next term $[T(n+1)]$ is value of current term $[T(n)]$ plus $ 2n$ Thus, we can say If my next term is $n$, my current term becomes $n-1$ So we can write the equation as- $T(n)=T(n-1)+2(n-1)$ and now we can solve by usual substitution method. PS: Its a minor change in question, but can be challenging in exam temperament. 0 0 replyShare Please log in or register to add a comment.
2 2 votes If you observe: T(n+1) = T(n) + 2n It is a decreasing expression. From the Master's Theorem: a = 1, b = 1 => O(n * f(n)) => O(n * 2n) => O(n^2) Amjad. answered Apr 10, 2025 Amjad. comment Share Follow See 1 comment 1 1 comment reply EagerLearner commented Aug 18 reply Follow flag To apply Master's theorem you need to have/make a>= 1 and b>1. This is like explicitly mentioned in the definitionSo, what you did is wrong. 0 0 replyShare Please log in or register to add a comment.