in Algorithms retagged by
3,882 views
3 votes
3 votes

Which of the following sorting procedures is the slowest?

  1. Quick Sort
  2. Merge Sort
  3. Shell Sort
  4. Bubble Sort
in Algorithms retagged by
by
3.9k views

2 Answers

4 votes
4 votes
Option D  Bubble Sort

Time complexity of merge sort is $O(nlogn)$ in all cases best ,average, worst

time complexity of quick sort in best case $O(nlogn)$ and in worst case $O(n^{2})$

time complexity of sell sort in best case $O(nlogn)$ and in worst case $O(n^{2})$

Time complexity of Bubble sort take  $O(n^{2})$ in all case best ,average ,and worst so bubble sort is slowest in among all.

2 Comments

Bubble Sort takes Ω(n) in the best case. The option provided is not correct.

Ref: https://www.geeksforgeeks.org/time-complexities-of-all-sorting-algorithms/

1
1
I guess since it is talking about the slowest algorithm, we must consider TC in worst case to benchmark the performance of the algorithm, so all the given options are right
0
0
2 votes
2 votes
Option D ) Bubble sort is slowest because , Average case complexity of bubble sort is O(n^2)

                 , Avg. case complexity of quick sort and merge sort is O(nlogn)       

                 , Avg. case complexity of shell sort is O(n^3/2)
Answer: