COP 4531: Lecture 9

Learning objectives

After this class, you should be able to:

  1. Given an array A and a pivot x, show how the partitioning algorithm in the text will partition A with pivot x.
  2. Given an array, show the steps taken by quicksort to sort the array.
  3. Given a positive integer n, give an input of size n on which quicksort performs best.
  4. Given a positive integer n, give an input of size n on which quicksort performs worst.

Reading assignment

  1. CLR: Sections 7.1 - 7.2.
  2. CLR: Chapter 2, section 7.3.

Exercises and review questions


Last modified: 7 Feb 2007