PA of Algorithms Q105

0. The median of n elements can be found in O(n) time. Which one of the following is correct about the complexity of quick sort, in which remains is selected as pivot?

  • Option : B
  • Explanation :
    T(n) = T(n/2) + T(n/2) + O(n) (for partition) + O(n) (for finding median)
    On solving above using
    Masters Method T(n) = O(n log 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 *