PA of Algorithms Q94

0. If T1 = O(1), give the correct matching for the following pairs:

  • Option : D
  • Explanation :
    T(n) = T(n–1)+n ⇒ O(n2)
    T(n) = T(n/2) + n ⇒ O(n)
    T(n) = T(n/2) + n logn ⇒ O(n logn)
    T(n) = T(n–1) + logn ⇒ O(log2n)
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 *