11,587 views
8 votes
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$?

  1. $O(n)$
  2. $O(n \log n)$
  3. $O(n^2)$
  4. $O(n^3)$

1 Answer

Best answer
12 votes
12 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})$ 

selected by
Answer:

Related questions

9 votes
9 votes
3 answers
1
go_editor asked Jun 23, 2016
21,549 views
The average depth of a binary search tree is$O(n^{0.5})$$O(n)$$O(\log n)$$O(n \log n)$
7 votes
7 votes
2 answers
2
go_editor asked Jun 23, 2016
7,891 views
Which of the following algorithm design technique is used in merge sort?Greedy methodBacktrackingDynamic programmingDivide and Conquer
5 votes
5 votes
5 answers
3
go_editor asked Jun 22, 2016
5,121 views
Consider the following pseudocodex:=1; i:=1; while ( x <= 500) begin x:=2^x; i:=i+1; endWhat is the value of $\textsf{i}$ at the end of the pseudocode?$4$$5$$6$$7$
3 votes
3 votes
2 answers
4
ajit asked Oct 1, 2015
6,934 views
Number of comparisons required for an unsuccessful search of an element in a sequential search organized, fixed length, symbol table of length L isLL/2(L+1)/22L