Google
Company
Programming
Two n-size arrays are given to you. n1 in decreasing order and n2 in increasing order. If c1 is time complexity for n1 using quicksort and c2 is time complexity for n2 using quicksort. Then –
A) c1 > c2 B) c1 < c2 C) c1 = c2 D) None of these
Read Solution (Total 1)
-
- Answer is (c) because quicksort performs in worst case when input is sorted either in increasing order or decreasing order. So quicksort will return equal no. of comparisons for both given inputs.
- 4 years agoHelpfull: Yes(1) No(0)
Google Other Question