Selection Sort

Selection sort builds a list of sorted items at the end of the dataset as it goes along. When it finds a value smaller than the lowest value in the sorted section, it places it at the start of the sorted section and narrows its search by one index, so as not to process the already sorted data again. Selection sort performs poorly, consistently at O(n^2), but has minimal space complexity and is ideal for cases like flash memory where write cycles must be minimized.