GATE CSE
First time here? Checkout the FAQ!
x
+1 vote
74 views

Choose the correct alternatives (More than one may be correct).

The complexity of comparision based sorting algorithms is:

  1. $\Theta (n \log n)$
  2. $\Theta (n)$
  3. $\Theta \left(n^2\right)$
  4. $\Theta (n\sqrt n)$
asked in Algorithms by Veteran (29k points)   | 74 views

1 Answer

0 votes

Only A & C are possible in Comparision based sorting   

Algorithm Time Complexity
  Average Worst
Quicksort O(n log(n)) O(n^2)
Mergesort O(n log(n)) O(n log(n))
Heapsort O(n log(n)) O(n log(n))
Bubble Sort O(n^2) O(n^2)
Insertion Sort O(n^2) O(n^2)
Select Sort O(n^2) O(n^2)
answered by Veteran (11.4k points)  
edited by
When question says "The complexity of comparision based sorting algorithms" we should consider all comparison based algorithms together and not separately. So, answer must be A and C is false.

@Arjun sir Isn't the question is asking what are the complexities possible in comparision based sorting

Just option A is Θ(nlogn) whereas for selection sort and bubble sort Θ(n2)

So we should consider both 

Members at the site
Top Users Feb 2017
  1. Arjun

    4676 Points

  2. Bikram

    4004 Points

  3. Habibkhan

    3738 Points

  4. Aboveallplayer

    2966 Points

  5. sriv_shubham

    2278 Points

  6. Smriti012

    2212 Points

  7. Arnabi

    1814 Points

  8. Debashish Deka

    1788 Points

  9. sh!va

    1444 Points

  10. mcjoshi

    1444 Points

Monthly Topper: Rs. 500 gift card

20,788 questions
25,938 answers
59,532 comments
21,923 users