T.length ∈ N
T[i] ∈ R
SELECT-SORT(T)
for i = 1 to T.length - 1
k = i
for j = i + 1 to T.length
if T[j] < T[k]
k = j
tmp = T[i]
T[i] = T[k]
T[k] = tmp
T.length ∈ N
T[i] ∈ R
INSERT-SORT(T)
for j = 2 to T.length
r = T[j]
i = j - 1
while i > 0 AND T[i] > r
T[i + 1] = T[i]
i = i - 1
T[i + 1] = r