Gate2017 ss Q26

0. Match the algorithms with their time complexities:

  • Option : C
  • Explanation :
    P. Towers of Hanoi
    ⇒ T(n) = 2T(n-1) + 1 ⇒ θ(2n)
    Q. Binary search
    ⇒ T(n) = T(n/2) + c ⇒ θ(log n)
    R. Heap sort ⇒ θ(nlog n)
    S. Addition of two n × n matrices ⇒ θ(nr)
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 *