SelectionSort
Selectionsort, or selection sort, is a simple in-place sorting algorithm. It orders a list by repeatedly selecting the smallest (or largest) element from the unsorted portion and moving it to its final position, expanding the sorted region from the front.
During each pass, the algorithm maintains a boundary between the sorted portion at the front and the
Time complexity: the number of comparisons is always n(n-1)/2, so the running time is Theta(n^2) in all
Stability: standard selection sort is not stable, because elements equal to the chosen minimum may be moved
Algorithm (pseudocode): Procedure selectionSort(A): for i from 0 to length(A)-2: minIndex = i; for j from i+1