This preview shows page 1. Sign up to view the full content.
Unformatted text preview: /2)+ n , T (1) = 1 T ( n ) = 4 T ( n /2)+ n 2 , T (1) = 1 T ( n ) = 4 T ( n /2)+ n 3 , T (1) = 1 4. Generate all permutations of {1, 2, 3, 4} by JohnsonTrotter algorithm. 5. Apply the partitionbased algorithm to find the median of the list of numbers 4, 1, 11, 9, 7, 13, 8, 3, 18. 6. Does the partitionbased algorithm used in question 5 qualify for the variablesizedecrease approach? Justify your answer. 7. Give specific examples of inputs that make the quickhull algorithm run in linear time (the bestcase) and quadratic time (the worstcase). 8. Answer the question 7 from the Exercise 4.2 to solve the averagecase recurrence for quicksort....
View Full
Document
 Fall '08
 Kraft,D

Click to edit the document details