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.42 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 worstcase input for the revised QUICKSORT procedure. b) Provide an example of an array of elements that constitutes a bestcase input for the revised QUICKSORT procedure. 4. (35 points) Hoare Partition : Textbook Problem 71 on p. 185186, 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
 DR.KARENDANIELS
 Algorithms

Click to edit the document details