PA of Algorithms Q104

0. Quicksort is run on two inputs shown below to sort in ascending order
(i) 1, 2, 3 ............. n
(ii) n, n–1,n–2, ..., 2, 1
Let C1 and C2 be the number of comparisons made for the inputs (i) and (ii) respectively. Then,

  • Option : C
  • Explanation :
    If Input is either in ascending order or in descending order both are worst case of quick sort algorithm
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 *