 |  Introduction to Algorithms, 2/e Thomas H. Cormen,
Dartmouth College Charles E. Leiserson,
Massachusetts Institute of Technology Ronald L. Rivest,
Massachusetts Institute of Technology Clifford Stein,
Columbia University
Quicksort
Chapter Objectives[The treatment in the second edition differs from that of the first edition. We use
a different partitioning method—known as “Lomuto partitioning”—in the second
edition, rather than the “Hoare partitioning” used in the first edition. Using Lomuto
partitioning helps simplify the analysis, which uses indicator random variables in
the second edition.]Quicksort
• Worst-case running time: Θ (n2).
• Expected running time: Θ (n lg n).
• Constants hidden in Θ (n lg n) are small.
• Sorts in place.
|