225_11_quickSort - 1 Problem of the Day Assume that n= 2...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 Problem of the Day Assume that n= 2 k+1-1. Solve this recurrence using repeated substitution showing all your work: T(n)= (n+1) + 2 T((n-1)/2), T(1)=1. Hint: These are a lot easier to solve if you express the equations in terms of k before starting. For more of a challenge, solve this one: T(n)= n + 2 T((n-1)/2), T(1)=1. 2 Quicksort A well-known sorting algorithm developed by C. A. R. Hoare in 1962 that, on average, makes (nlogn) (big O notation) comparisons to sort n items. However, in the worst case, it makes (n 2 ) comparisons . Typically, quicksort is significantly faster in practice than other (nlogn) algorithms, because its inner loop can be efficiently implemented on most architectures, and in most real-world data, it is possible to make design choices which minimize the probability of requiring quadratic time....
View Full Document

Page1 / 8

225_11_quickSort - 1 Problem of the Day Assume that n= 2...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online