PA of Algorithms Q58

0. Consider the following C functions:

  • Option : B
  • Explanation :
    Recurrence relation for f1()is
    T (n) = 2T (n–1) + 3 T (n–2)
    After solving it would be Θ(1.6)n) so the largest
    value among the options is Θ(2n).
    f2() is simple loop executed n times.
    So Θ(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 *