|
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
Sort
in class the following:
|
|
|
|
– |
29,
10, 14, 37, 13, 12, 30, 20
|
|
|
| • |
Notice
that the selection sort doesn't require
|
|
|
as
many data moves as Insertion Sort.
|
|
|
| • |
Therefore,
if moving data is expensive (i.e.,
|
|
|
|
you
have large structures), a selection sort
|
|
|
|
would
be preferable over an insertion sort.
|
|
|
|