procedure insertionSort( A : list of sortable items ) n = length(A) for i = 1 to n-1 inclusive do current = A[i] j = i - 1 while j>=0 and A[j] > current A[j+1] = A[j] j = j - 1 end while A[j+1] = current end for end procedure