| | |
Summary: 1/25
Analysis of Algorithms
Lecture 9
Max Alekseyev
University of South Carolina
September 16, 2010
2/25
Outline
Quicksort
Randomized Quicksort
3/25
Quicksort
Quicksort is a divide-and-conquer sort that takes (n2) time in
the worst case but (n lg n) time in the average case.
Like Mergesort, it splits the list in two, sorts both sublists
recursively, then recombines the results. Unlike Mergesort, the
major work is in splitting the list, while the recombination is trivial.
Properties:
Worst-case running time: (n2).
Expected running time: (n lg n).
|