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