Data Structures and Algorithms - Performance Analysis of Algorithms and Recurrences

Avatto > > UGC NET COMPUTER SCIENCE > > PRACTICE QUESTIONS > > Data Structures and Algorithms > > Performance Analysis of Algorithms and Recurrences

76. Find a solution to the following recurrence equation
T(n) = T(n/2) + n
T(1) = 1

  • Option : A
  • Explanation :
    T (n) = T (n/2) + n
    Apply masters method
    nlog21 ⇒ n0
    1 < n
    T(n) = O(n)
Cancel reply
Cancel reply

77. The recurrence relation
T(1) = 2
T(n) = 3T(n/4) + n
Has the solution T(n) equal to

  • Option : A
  • Explanation :
    T(n) = 3T (n/4) + n
    Apply master’s method
    nlog43 < n
    So O(n)
Cancel reply
Cancel reply

78. Let T(n) be the function defined by

  • Option : A
  • Explanation :
    T (n) = T (n/2) + √n
    Apply master’s method
    nlog21 = n0 = 1 < √n
    So O(√n)
Cancel reply
Cancel reply

79. A sorting technique is called stable if

  • Option : B
  • Explanation :
    A sorting technique is called stable if it maintains the relative order of occurrence of non distinct elements
Cancel reply
Cancel reply