Significance of selection sort

2019-09-16 17:44发布

What is the significance of selection sort? It has a time complexity of O(n^2) even in best case scenario. So why is it still prevalent?

1条回答
We Are One
2楼-- · 2019-09-16 18:29
  • It is simple to write and intuitive for people to understand
  • It is the closest to the way real humans approach sorting lists.
  • It functions in-place in memory
  • After n iterations you know the first n elements are sorted. After the first iteration the first item is sorted, after the second is finished the first 2 are sorted, etc...
查看更多
登录 后发表回答