COP 4531: Lecture 9
Learning objectives
After this class, you should be able to:
- Given an array
A
and a pivotx
, show how the partitioning algorithm in the text will partitionA
with pivotx
.- Given an array, show the steps taken by quicksort to sort the array.
- Given a positive integer
n
, give an input of sizen
on which quicksort performs best.- Given a positive integer
n
, give an input of sizen
on which quicksort performs worst.
Reading assignment
- CLR: Sections 7.1 - 7.2.
- CLR: Chapter 2, section 7.3.
Exercises and review questions
- Questions on current lecture's material
- Show how quicksort will sort the array given in exercise 7.1-1.
- Exercise 7.2-1.
- Exercise 7.2-2.
- Questions on next lecture's material
- How does randomized quicksort differ from the one discussed in section 7.1?