A comparison sort that repeatedly finds the smallest remaining element and moves it into its final sorted position, making the same number of comparisons regardless of the input's initial order.
Facts
Time Complexity Space Complexity Time Complexity
Time Complexity (category)Quadratic Time -- O(n^2) 1 Connections
Sources
1. Wikipedia, Selection sort
Lead section
It has a O(n2) time complexity, which makes it inefficient on large lists, and generally performs worse than the similar insertion sort.
- Wikipedia Selection sort infobox time O(n^2) comparisons
Article text
It has a O(n2) time complexity, which makes it inefficient on large lists, and generally performs worse than the similar insertion sort.
View the Source2. Big-O Cheat Sheet: Big-O Cheat Sheet
Big-O Cheat SheetArray Sorting Algorithms tableQuote, Array Sorting Algorithms table
Selection Sort Ω(n^2) Θ(n^2) O(n^2) O(1)
View the Source Wikidata: Selection Sort
Reader Challenges (0)
No disputes yet. Spotted an error or a better source? Open the first one.
Sign in to dispute this or suggest a correction.