 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
Usually
the quicksort will run faster than
|
|
|
|
the
mergesort...
|
|
|
|
– |
but
if you are dealing with already sorted or
|
|
|
|
mostly
sorted data, you will get worst case
|
|
|
|
performance
out of the quicksort which will be
|
|
|
|
significantly
slower than the mergesort.
|
|
|
|
– |
with
an array that is already sorted in ascending
|
|
|
order
and the pivot is always the smallest
|
|
|
|
element
in the array, then there are N-1
|
|
|
|
comparisons
for N elements in your array.
|
|