364 views

2 Answers

Best answer
5 votes
5 votes
$T(n) = T(n-1) + 4 \\= T(n-2) + 8 \\=T(n-3) + 12 \\\dots\\=T(1) + (n-1)4\\=4+(n-1)4\\=4n.$

So, $T(1000) = 4000.$
selected by
2 votes
2 votes

The recurrence relation is similar to sequential search algoithm

So T(n) can be written as O(n)

=> T(n)=C*n(C is constant here)

T(1)=4 that means C=4

T(1000) would be 4*1000=4000

So Answer is 4000

Answer:

Related questions

2 votes
2 votes
2 answers
1
Bikram asked Oct 4, 2016
569 views
Consider the following recurrence relation.$$T(n) = \begin{cases}1 & \quad if \: n = 1 \\ T(n-1) + 2^n \quad & otherwise \end{cases}$$What will be the value of $T(10)$?