PA of Algorithms Q24

  • Option : A
  • Explanation :
    For sufficiently large n,
    T(n)=Tn−1)+T(n−2)−T(n−3).
    If the order of the algorithm for which above recurrence is applicable for the time complexity, is a constant,
    T(n)=T(n−1).
    ⟹T(n)=T(n)+T(n−2)−T(n−3)
    ⟹T(n−2)=T(n−3)
    Going like this, we must have T(1)=T(2)=T(3) which is option A.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *