in Algorithms
10,731 views
24 votes
24 votes

Which of the following sorting algorithms has the lowest worse-case complexity?

  1. Merge sort

  2. Bubble sort

  3. Quick sort

  4. Selection sort

in Algorithms
10.7k views

2 Comments

i think Bubble sort could be the answer , because if we use modification : Early termination, i.e No swapping in the inner loop then it will be O(n)
0
0
if we do not go with bubble sort early termination modification then ---merge sort if right answer, heap sort also having lowest worst case time complexity O(nlogn) as like merge sort.
0
0

4 Answers

29 votes
29 votes
Best answer

Correct Option: A

Irrespective of the input, merge sort always have a time complexity of  $\Theta(n \log n)$.

edited by
8 votes
8 votes
Merge sort has lowest worst case time complexity i.e O(nlogn)
edited by
4 votes
4 votes
MERGE SORT all others have the worst case complexity O(n^2)
0 votes
0 votes
Irrespective of everything worst case for quick sort,bubble srt and selections sort  is  O(n^2)

 

Whereas for merge sort it is O(nlog n)
Answer:

Related questions