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

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


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

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


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

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


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

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


80. Randomized quicksort is an extension of quicksort where the pivot is chosen randomly. What is the worst case complexity of sorting n numbers using randomized quicksort?

  • Option : C
  • Explanation :
    The worst case time complexity is O (n2)
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 *