Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When would someone ever use selection sort?

If there are so many faster and more efficient sorting algorithms available (merge sort, heap sort, quick sort), why is selection sort still taught? If it is because they are still used, when are some examples where this would be true?

like image 944
Henry Wang Avatar asked Jul 16 '26 05:07

Henry Wang


1 Answers

I believe it's still taught because it's a simple algorithm to understand and helps build the foundation for other sorting algorithms. It's also an easy exercise in understanding time and space complexity for algorithms. Not aware of any practical usages in modern computing, but it does have very low memory overhead so can be ideal for situations where memory is at a premium.

like image 63
Mike Avatar answered Jul 23 '26 20:07

Mike