Unformatted text preview: clearer. Is the modiﬁed algorithm faster than Ω( NlogN ) in the best case? Why or why not? 3. Do problem 7.31 from the text for insertion sort, bubble sort, mergesort, and quicksort. If there is an obvious and easy way to make the sort stable, assume that it is part of the algorithm and state what it is. 4. Consider problem 7.38 from the text. (a) Give a clearly O ( N ) algorithm for ﬁnding the median. (b) Now give an algorithm that is O ( logN ), as asked in the text. Be sure to include an argument for why your algorithm is O ( logN ). Note that A and B represent sets in this problem. You may assume that there are no duplicate elements in A and that there are no duplicate elements in B. 5. Give a format argument, based on the deﬁnition of Big Theta, proving that f ( N ) = 3 N 27 N + 5 is Θ( N 2 ). 1...
View
Full
Document
This note was uploaded on 07/25/2008 for the course CSE 331 taught by Professor M.mccullen during the Spring '08 term at Michigan State University.
 Spring '08
 M.McCullen
 Algorithms, Data Structures

Click to edit the document details