INSERTION_SORT(A) for i ← 1 to n-1 do v ← A[i] j ← i-1 while j ≥ 0 and A[j] > v do A[j+1] ← A[j] j ← j-1 A[j+1] ← v