# Class 45: Quicksort

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

This outline is also available in PDF.

Held: Friday, 17 November 2006

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

Related Pages:

Due

Notes:

• HW16 is the last homework for 151.

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 Nov 30 21:43:35 2006.
The source to the document was last modified on Mon Sep 4 08:43:35 2006.
This document may be found at `http://www.cs.grinnell.edu/~rebelsky/Courses/CS151/2006F/Outlines/outline.45.html`.

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

Samuel A. Rebelsky, rebelsky@grinnell.edu

Copyright © 2006 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.