This preview shows page 1. Sign up to view the full content.
Unformatted text preview: (including swaps needed to build the heap)? How meaningful is this result in terms of comparing the asymptotic running time of the two sorting procedures? 2 . (30 points) QUICKSORT Analysis: Textbook Exercise 7.4-2 on p. 184. 3 . (10 points) Suppose that the PARTITION procedure of QUICKSORT is modified to always use the first element as the pivot (instead of the last element). In this case: a) Provide an example of an array of elements that constitutes a worst-case input for the revised QUICKSORT procedure. b) Provide an example of an array of elements that constitutes a best-case input for the revised QUICKSORT procedure. 4. (35 points) Hoare Partition : Textbook Problem 7-1 on p. 185-186, parts (a)-(d)...
View Full Document
This note was uploaded on 02/13/2012 for the course CS 91.404 taught by Professor Dr.karendaniels during the Fall '09 term at UMass Lowell.
- Fall '09