The algorithm proceeds by finding the smallest (or largest, depending on sorting order) component in the unsorted sublist, exchange (swapping) it with the leftmost unsorted component (putting it in sorted order), and move the sublist boundaries one component to the right. It has an O(n2) time complexity, which makes it inefficient on large lists, and generally performs worse than the like insertion sort.

COMING SOON!

```
package sort
/**
* This method implements the Generic Selection Sort
*
* @param array The array to be sorted
* Sorts the array by repeatedly finding the minimum element from unsorted part and putting in the beginning
*
* Worst-case performance O(n^2)
* Best-case performance O(n^2)
* Average performance O(n^2)
* Worst-case space complexity O(1)
**/
fun <T: Comparable<T>> selectionSort(array: Array<T>) {
val length = array.size - 1
for (i in 0..length) {
var idx = i
for (j in i+1..length) {
if (array[j] < array[idx]) {
idx = j
}
}
swapElements(array, i, idx)
}
}
```