Order of Growth?
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
}
LOOP 1
Q(1)
Q(1)
Q(1)
LOOP 2
Previous slide
Next slide
Back to first slide
View graphic version