for j = 2 to A.length do
key = A[j]
i = j-1
while (int i >= 0 and A[i] > key) do
A[i + 1] = A[i]
i = i - 1
end while
12345 for i = 2 to n do
x = A[i]
j = i
while (int j > 1 and A[j-1] > x) do
A[j] = A[j-1]
1244
123 for j = 2 to A.length do
key = A[j]
i = j-1
while (int i >= 0 and A[i] > key) do
A[i + 1] = A[i]
i = i - 1
end while
123