 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
Also,
if you are dealing with an array that is
|
|
already
sorted in descending order and the
|
|
|
pivot
is always the largest element in the
|
|
|
array,
there are N*(N-1)/2 comparisons and
|
|
|
N*(N-1)/2
exchanges (requiring 3 data
|
|
|
moves
each).
|
|
|
| • |
Therefore,
we should be able to quickly
|
|
|
remember
that this is just like the insertion
|
|
|
sort
-- and in the worst case has an
|
|
|
efficiency
of O(N2).
|
|