Algorithm type: Sorting algorithm
Can work in-place: No
Stable: Stable if the algorithm takes the first minimum, when two equal minimal numbers occur.
Time complexity: O(n2)
function sort(inputValues: List)
insertIndex ← 0
for i ← 0 to |inputValues| -1 do
min ← i
for j ← i + 1 to |inputValues| do
if inputValues[j] < inputValues[min] then min ← j
end for
interchange inputValues[min] and inputValues[insertIndex]
insertIndex ← insertIndex + 1
end for
return inputValues
end function
© Marc Auberer 2020