Asked • 04/23/19

Why is selection sort faster than bubble sort?

[It is written on Wikipedia](http://en.wikipedia.org/wiki/Selection_sort#Comparison_to_other_sorting_algorithms) that "... selection sort almost always outperforms bubble sort and gnome sort." Can anybody please explain to me why is selection sort considered faster than bubble sort even though both of them have: 1. **Worst case time complexity**: $\\mathcal O(n^2)$ 2. **Number of comparisons**: $\\mathcal O(n^2)$ 3. **Best case time complexity** : * Bubble sort: $\\mathcal O(n)$* Selection sort: $\\mathcal O(n^2)$4. **Average case time complexity** : * Bubble sort: $\\mathcal O(n^2)$* Selection sort: $\\mathcal O(n^2)$

1 Expert Answer

By:

Isaac W. answered • 12/04/20

Tutor
5 (35)

Tutor for Computer Science at UH

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.