|
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
Every
sorting algorithm has
|
|
|
|
a
corresponding comparison
|
|
|
|
tree
|
|
|
|
– |
Note
that other stuff
|
|
|
|
happens
during the sorting
|
|
|
|
algorithm,
we just aren’t
|
|
|
|
showing
it in the tree
|
|
|
| • |
The
comparison tree must
|
|
|
have
n! (or more) leaves
|
|
|
|
because
a valid sorting
|
|
|
|
algorithm
must be able to get
|
|
|
any
of n! possible answers
|
|
|
|
 |
 |
 |
| • |
Comparison
tree for sorting
|
|
|
n
items:
|
|
|
|