COP 4531: Lecture 10
Learning objectives
After this class, you should be able to:
- Given an array and a sequence of random numbers, show how randomized quicksort will sort the array.
 - Analyze the worst case and average case time complexities of quicksort.
 - Given a problem, choose a suitable sorting algorithm that will be efficient for that problem.
 
Reading assignment
- CLR: Sections 7.3 - 7.4.
 - CLR: Chapter 8, page 166.
 Exercises and review questions
- Questions on current lecture's material
 
- Show that
 q2 + (n-1-q)2, 0 < q < n-1, is maximized whenq = 0orq = n-1.- Questions on next lecture's material
 
- (Post your solution on the discussion board) Give an example of an array that is not already in sorted order, and give the permutation corresponding to this array. Note: The desired permutation is the set of values of
 pi(1), pi(2), pi(3),andpi(4), as presented on page 166, and in particular, in figure 8.1.- What is the maximum number of leaves in a binary tree of height
 h?