In computer science, selection sort is an in-place comparison sorting
algorithm. It has an ==O(N2)== time complexity, which makes it inefficient
on large lists, and generally performs worse than the similar insertion sort.
Selection sort is noted for its simplicity and has performance advantages over
more complicated algorithms in certain situations, particularly where
auxiliary memory is limited.
— Selection sort - Wikipedia
Selection sort in action
We compare each value with the lowest number we’ve encountered in each
pass-through, and we swap the lowest number into its correct position.
For N elements, we make ==(N−1)+(N−2)+(N−3)…+1== comparisons with
selection sort.
Selection Sort takes about half the number of steps
Bubble Sort does, indicating that selection sort is
much faster than bubble sort.
Code implementation: Selection sort
Can you write selection sort, at least basic implementation?