 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
Now
look at the case where we have a
|
|
|
randomly
ordered list and pick reasonably
|
|
|
good
pivot values that divide the list almost
|
|
equally
in two.
|
|
|
|
– |
This
will require fewer recursive calls (either
|
|
|
log2N
or 1+log2N recursive calls).
|
|
|
|
– |
Each
call requires M comparisons and at most
|
|
|
M
exchanges, where M is the number of
|
|
|
elements
in the unsorted area and is less than
|
|
|
N-1.
|
|