 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
Notice
that partitioning the list is probably
|
|
|
|
the
most difficult part of the algorithm.
|
|
|
| • |
It
must arrange the elements in two regions:
|
|
|
|
those
greater than the pivot and those less.
|
|
|
|
– |
The
first question which might come to mind is
|
|
|
|
which
pivot to use?
|
|
|
|
– |
If the elements are arranged randomly,
you can
|
|
|
chose
a pivot randomly.
|
|