Quicksort

As its name suggests, Quicksort is one of the better sort algorithms; it is O(n · log(n)) (though it can be O(n2) in the worst case). In practice it is significantly faster than other algorithms.

Quicksort is a divide-and-conquer algorithm that chooses a pivot value, then partitions the array into two sections with the pivot in its final position in the middle:

elements &le pivot pivot elements > pivot

The outside sections are then sorted recursively.

The partitioning can be done in-place, making Quicksort an in-place sort. Since partitioning is done in-place by swapping elements, Quicksort is not stable.

Contents    Page-10    Prev    Next    Page+10    Index