Selection Sort

Selection Sort is a sorting algorithm that sorts a list from left to right by taking the smallest(or largest, depending on sorting order) unsorted value and swapping it with the leftmost unsorted value upon each iteration. Once the value is swapped with the leftmost unsorted values, it is then considered a sorted value, and after the algorithm has done this for every value in the list, then the entire list will have been sorted.

[Example] [Example]
[Resource] [Resource]

Performance
Worst case performance О(n2)
Best case performance Ω(n2)
Average case performance Θ(n2)

Step by Step

selection sort step by step

Leave a comment