Turing machines Q20

0. The running time T (n), where 'n' is input size of a recursive algorithm, is given as
                                                      T (n) = c + T (n - 1), if n > 1
                                                   = d, if n ≤ 1
The order of the algorithm is

  • Option : B
  • Explanation : Recuesivelt applying the relation, we get
    T( n + 1 ) = C ( n - 1 ) + T (1)
                     = C ( n - 1 ) + d
    Hence order is n.
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 *