Insertion Sort
Unsorted - shaded
Look at 2nd item - 5
Compare 5 to 7
5 is smaller, so move 5 to temp, leaving
an empty slot in
position 2
Move 7 into the empty
slot, leaving position 1
open
Move 5 into the open
position
7
7
5
7
5
7
K
5
7
v
>
<
1
2
3
Previous slide
Next slide
Back to first slide
View graphic version