You are on page 1of 1

DIVIDE-AND-

CONQUER

DIVIDE-AND-CONQUER

QUICKSORT

Choose a Pivot (say, at the


first postion of the array). Order of Growth in Order of Growth in
Best Case Θ(n log n) Average Case Θ(1.39n
log n)

Take two references, one Order of Growth in


at the beginning (after the Worst Case Θ(n²)

pivot) and one at the end

Quicksort makes only 39%


more comparisons in the It is not stable
average case compared to
The left one (i), will increase The right one (j), will
the best case
its position untill the decrease its position untill
It requires a stack to
element in the position is the element in the position
Its innermost loop is so store parameters of
higher than the pivot is lower than the pivot efficient that it usually subarrays that are yet
runs faster than merge
to be sorted
and heapsort
Then, they exchange their
This process goes until the Sensitive to the
values, the pivot goes to the There are improvements
middle and the function gets initial position is in a that can cut the computer architecture
recalled with half of the array higher index than the end algorithm's running time and data type
by 20%-30%

Artur Carvalho dos Santos - acs9@cin.ufpe.br

You might also like