Question related to recurrence relation

The running time of an algorithm is given by:

                      T(n)=T(n−1)+T(n−2)−T(n−3)T(n)=T(n−1)+T(n−2)−T(n−3), if n>3n>3

                                  = n, otherwise

Then what should be the relation between T(1),T(2),T(3)T(1),T(2),T(3), so that the order of the algorithm is constant?

  1. T(1)=T(2)=T(3)T(1)=T(2)=T(3)
  2. T(1)+T(3)=2T(2)T(1)+T(3)=2T(2)
  3. T(1)−T(3)=T(2)T(1)−T(3)=T(2)
  4. T(1)+T(2)=T(3)
Author: singhV
Login to Answer
Sort By:
Oldest
|
Newest
|
Vote
|
My Answer