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
 Spring '08
 M.McCullen
 Algorithms, Data Structures, Insertion Sort, Big O notation, Handin, explicit code examples

Click to edit the document details