Insertion Sort - pseudocode
INSERTION-SORT(A[]) ::=
{
For i := 2 to n
key := A[i]
j := i -1;
while (j > 0) and (A[j] > key) do
A[j+1] := A[j]
j := j - 1
A[j+1] := key
}
Previous slide
Next slide
Back to first slide
View graphic version