Week 5: Algorithm analysis,
searching, sorting
Applications
n
Insertion Sort
–
Linear for almost sorted arrays.
–
Linear in arrays where items are a constant
distance from their final position.
–
n
Selection Sort
–
Useful for large records.
–