# Class 47: Quicksort

Back to Merge Sort. On to Variable-Arity Procedures.

This outline is also available in PDF.

Held: Wednesday, April 25, 2007

Summary: Today we consider our final sorting algorithm, Quicksort. Quicksort is a divide-and-conquer algorithm that also relies on chance.

Related Pages:

Notes:

• Are there questions on HW16?
• EC for tomorrow's convo.

Overview:

• The key ideas of Quicksort.
• Lab.

## Key Ideas of Quicksort

• Another divide-and-conquer algorithm.
• This time, divide into small and large.
• What do we do after sorting the two halves? Append 'em. (Much easier.)
• How do we divide into small and large? Guess the dividing point by selecting a random element.

## Lab

Back to Merge Sort. On to Variable-Arity Procedures.

Disclaimer: I usually create these pages on the fly, which means that I rarely proofread them and they may contain bad grammar and incorrect details. It also means that I tend to update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.

This document was generated by Siteweaver on Thu Sep 13 20:54:54 2007.
The source to the document was last modified on Thu Jan 18 12:30:12 2007.
This document may be found at `http://www.cs.grinnell.edu/~rebelsky/Courses/CS151/2007S/Outlines/outline.47.html`.

You may wish to validate this document's HTML ; ;

Samuel A. Rebelsky, rebelsky@grinnell.edu

Copyright © 2007 Samuel A. Rebelsky. This work is licensed under a Creative Commons Attribution-NonCommercial 2.5 License. To view a copy of this license, visit `http://creativecommons.org/licenses/by-nc/2.5/` or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.